This commit is contained in:
boy0001
2015-07-26 14:11:18 +10:00
parent 4231ae6755
commit 08cc8c58f2
7 changed files with 23 additions and 40 deletions

View File

@ -65,24 +65,6 @@ public class DebugExec extends SubCommand {
if (args.length > 0) {
final String arg = args[0].toLowerCase();
switch (arg) {
case "biome": {
if (player == null) {
MainUtil.sendMessage(player, C.IS_CONSOLE);
return false;
}
Location loc = player.getLocation();
World world = Bukkit.getWorld(loc.getWorld());
int bx = (loc.getX() >> 4) << 4;
int bz = (loc.getZ() >> 4) << 4;
for (int x = bx; x < bx + 16; x++) {
for (int z = bz; z < bz + 16; z++) {
world.setBiome(x, z, Biome.DESERT);
}
}
MainUtil.update(loc.getWorld(), new ChunkLoc(loc.getX() >> 4, loc.getZ() >> 4));
System.out.print("SET BIOME TO FOREST: " + bx + "," + bz);
return true;
}
case "analyze": {
if (player == null) {
MainUtil.sendMessage(player, C.IS_CONSOLE);

View File

@ -69,18 +69,21 @@ public class Delete extends SubCommand {
sendMessage(plr, C.ADDED_BALANCE, c + "");
}
}
PS.get().removePlot(loc.getWorld(), plot.id, true);
final long start = System.currentTimeMillis();
final boolean result = MainUtil.clearAsPlayer(plot, true, new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start));
if (plot.unclaim()) {
final long start = System.currentTimeMillis();
final boolean result = MainUtil.clearAsPlayer(plot, true, new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start));
}
});
if (!result) {
MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER);
}
});
if (!result) {
MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER);
}
DBFunc.delete(plot);
else {
MainUtil.sendMessage(plr, C.UNCLAIM_FAILED);
}
}
};
if (Settings.CONFIRM_DELETE && !(Permissions.hasPermission(plr, "plots.confirm.bypass"))) {

View File

@ -57,13 +57,12 @@ public class Unclaim extends SubCommand {
sendMessage(plr, C.ADDED_BALANCE, c + "");
}
}
final boolean result = PS.get().removePlot(loc.getWorld(), plot.id, true);
if (result) {
plot.unclaim();
} else {
MainUtil.sendMessage(plr, "Plot removal has been denied.");
if (plot.unclaim()) {
MainUtil.sendMessage(plr, C.UNCLAIM_SUCCESS);
}
else {
MainUtil.sendMessage(plr, C.UNCLAIM_FAILED);
}
MainUtil.sendMessage(plr, C.UNCLAIM_SUCCESS);
return true;
}
}