mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
clear
This commit is contained in:
parent
2b0006b7f9
commit
2e7b5e794f
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user