This commit is contained in:
boy0001 2015-02-22 16:58:00 +11:00
parent 2b0006b7f9
commit 2e7b5e794f

View File

@ -68,17 +68,25 @@ public class Clear extends SubCommand {
if (plot == null) { if (plot == null) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
if (!MainUtil.getTopPlot(loc.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(loc.getWorld(), plot))) { if (!MainUtil.getTopPlot(loc.getWorld(), plot).equals(MainUtil.getBottomPlot( plot))) {
return sendMessage(plr, C.UNLINK_REQUIRED); return sendMessage(plr, C.UNLINK_REQUIRED);
} }
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.clear")) { if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.clear")) {
return sendMessage(plr, C.NO_PLOT_PERMS); return sendMessage(plr, C.NO_PLOT_PERMS);
} }
assert plot != null; assert plot != null;
boolean result = MainUtil.clearAsPlayer(plot, isDelete, whenDone); final long start = System.currentTimeMillis();
plot.clear(plr, false); boolean result = MainUtil.clearAsPlayer(plot, false, new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start));
}
});
if (!result) {
MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER);
}
// sign // sign
// wall // wall
return true; return result;
} }
} }