From 2e7b5e794fd2d86d8da933f517519ba18a95515a Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 22 Feb 2015 16:58:00 +1100 Subject: [PATCH] clear --- .../plot/commands/Clear.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java index 80021a350..67ba4cf7e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java @@ -68,17 +68,25 @@ public class Clear extends SubCommand { if (plot == null) { 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); } 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); } assert plot != null; - boolean result = MainUtil.clearAsPlayer(plot, isDelete, whenDone); - plot.clear(plr, false); + final long start = System.currentTimeMillis(); + 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 // wall - return true; + return result; } }