mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-02-11 19:50:38 +00:00
Fixes #1510
This commit is contained in:
parent
a628c5927f
commit
1129a80329
2 changed files with 20 additions and 2 deletions
|
@ -353,6 +353,10 @@ public class PS{
|
||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PlotAreaManager getPlotAreaManager() {
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Logger.
|
* Set the Logger.
|
||||||
* @see DelegateLogger
|
* @see DelegateLogger
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.intellectualcrafters.plot.commands;
|
package com.intellectualcrafters.plot.commands;
|
||||||
|
|
||||||
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.config.Settings;
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
import com.intellectualcrafters.plot.object.Expression;
|
import com.intellectualcrafters.plot.object.Expression;
|
||||||
|
@ -56,8 +57,21 @@ public class Auto extends SubCommand {
|
||||||
public boolean onCommand(PlotPlayer player, String[] args) {
|
public boolean onCommand(PlotPlayer player, String[] args) {
|
||||||
PlotArea plotarea = player.getApplicablePlotArea();
|
PlotArea plotarea = player.getApplicablePlotArea();
|
||||||
if (plotarea == null) {
|
if (plotarea == null) {
|
||||||
MainUtil.sendMessage(player, C.NOT_IN_PLOT_WORLD);
|
if (EconHandler.manager != null) {
|
||||||
return false;
|
for (PlotArea area : PS.get().getPlotAreaManager().getAllPlotAreas()) {
|
||||||
|
if (EconHandler.manager.hasPermission(area.worldname, player.getName(), "plots.auto")) {
|
||||||
|
if (plotarea != null) {
|
||||||
|
plotarea = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
plotarea = area;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (plotarea == null) {
|
||||||
|
MainUtil.sendMessage(player, C.NOT_IN_PLOT_WORLD);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int size_x = 1;
|
int size_x = 1;
|
||||||
int size_z = 1;
|
int size_z = 1;
|
||||||
|
|
Loading…
Reference in a new issue