This commit is contained in:
Jesse Boyd 2017-03-17 17:41:58 +11:00
parent a628c5927f
commit 1129a80329
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 20 additions and 2 deletions

View File

@ -353,6 +353,10 @@ public class PS{
return logger;
}
public PlotAreaManager getPlotAreaManager() {
return manager;
}
/**
* Set the Logger.
* @see DelegateLogger

View File

@ -1,5 +1,6 @@
package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.Expression;
@ -55,10 +56,23 @@ public class Auto extends SubCommand {
@Override
public boolean onCommand(PlotPlayer player, String[] args) {
PlotArea plotarea = player.getApplicablePlotArea();
if (plotarea == null) {
if (EconHandler.manager != null) {
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_z = 1;
String schematic = null;