diff --git a/pom.xml b/pom.xml index 3a28fd062..90b125973 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 2.12.18 + 2.12.19 PlotSquared jar diff --git a/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java b/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java index 0b141edab..d89ef65fd 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java @@ -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); diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Delete.java b/src/main/java/com/intellectualcrafters/plot/commands/Delete.java index 90f3db07b..e6388b65b 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Delete.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Delete.java @@ -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"))) { diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java b/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java index 6b2d1c8d5..5f12d8a0e 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java @@ -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; } } diff --git a/src/main/java/com/intellectualcrafters/plot/config/C.java b/src/main/java/com/intellectualcrafters/plot/config/C.java index c531a20d6..015ecaf84 100644 --- a/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -99,6 +99,7 @@ public enum C { * Unclaim */ UNCLAIM_SUCCESS("$4You successfully unclaimed the plot.", "Unclaim"), + UNCLAIM_FAILED("$2Could not unclaim the plot", "Unclaim"), /* * WorldEdit masks */ diff --git a/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/src/main/java/com/intellectualcrafters/plot/object/Plot.java index de83395ea..1f959df3f 100644 --- a/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -336,10 +336,12 @@ public class Plot { }); } - public void unclaim() { + public boolean unclaim() { if (PS.get().removePlot(world, id, true)) { DBFunc.delete(Plot.this); + return true; } + return false; } /** diff --git a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java index b9358c88f..0158fdd89 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java +++ b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java @@ -233,7 +233,6 @@ public abstract class SchematicHandler { for (int ry = 0; ry < Math.min(256, HEIGHT); ry++) { int yy = y_offset + ry; if (yy > 255) { - System.out.print("TOO HIGH: " + ry); continue; } int i1 = ry * WIDTH * LENGTH; @@ -323,7 +322,6 @@ public abstract class SchematicHandler { break; } default: { - System.out.print(id +","+datas[i]); SetBlockQueue.setBlock(plot.world, xx, yy, zz, new PlotBlock((short) id, (byte) datas[i])); break; } @@ -444,8 +442,6 @@ public abstract class SchematicHandler { // } // Schematic schem = new Schematic(collection, dimension, file); - System.out.print(width + "," + height +"," + length); - Dimension dimensions = new Dimension(width, height, length); Schematic schem = new Schematic(block, data, dimensions);