diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Merge.java b/src/main/java/com/intellectualcrafters/plot/commands/Merge.java index 96b0b0341..64c8b655c 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Merge.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Merge.java @@ -111,6 +111,11 @@ public class Merge extends SubCommand { } } else { + if (args[0].equalsIgnoreCase("all")) { + plot.autoMerge(args.length != 2 || !args[1].equalsIgnoreCase("false")); + MainUtil.sendMessage(plr, C.SUCCESS_MERGE); + return true; + } for (int i = 0; i < values.length; i++) { if (args[0].equalsIgnoreCase(values[i]) || args[0].equalsIgnoreCase(aliases[i])) { direction = i; diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java b/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java index ab9008a23..355ec0a93 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java @@ -56,11 +56,10 @@ public class Unlink extends SubCommand { if (MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) { return sendMessage(plr, C.UNLINK_IMPOSSIBLE); } - Runnable runnable = new Runnable() { @Override public void run() { - if (!MainUtil.unlinkPlot(plot)) { + if (!MainUtil.unlinkPlot(plot, true)) { MainUtil.sendMessage(plr, "&cUnlink has been cancelled"); return; } diff --git a/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/src/main/java/com/intellectualcrafters/plot/object/Plot.java index 489bb02fc..aa789b355 100644 --- a/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -595,11 +595,11 @@ public class Plot { /** * Unlink a plot and remove the roads - * @see MainUtil#unlinkPlot(Plot) + * @see MainUtil#unlinkPlot(Plot, boolean removeRoad) * @return true if plot was linked */ public boolean unlink() { - return MainUtil.unlinkPlot(this); + return MainUtil.unlinkPlot(this, true); } /** diff --git a/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java b/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java index 5b7af320a..dae1d118f 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java +++ b/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java @@ -130,7 +130,7 @@ public class ExpireManager { } } if (plot.isMerged()) { - MainUtil.unlinkPlot(plot); + MainUtil.unlinkPlot(plot, true); } plot.deletePlot(null); expiredPlots.get(world).remove(plot); diff --git a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index 63566922f..6205eb9b3 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -298,7 +298,7 @@ public class MainUtil { return MainUtil.mergePlots(world, plotIds, true, true); } - public static boolean unlinkPlot(final Plot plot) { + public static boolean unlinkPlot(final Plot plot, boolean createRoad) { final String world = plot.world; final PlotId pos1 = MainUtil.getBottomPlot(plot).id; final PlotId pos2 = MainUtil.getTopPlot(plot).id; @@ -324,7 +324,7 @@ public class MainUtil { myplot.getSettings().setMerged(new boolean[] { false, false, false, false }); DBFunc.setMerged(myplot, myplot.getSettings().getMerged()); } - if (plotworld.TERRAIN != 3) { + if (plotworld.TERRAIN != 3 && createRoad) { for (int x = pos1.x; x <= pos2.x; x++) { for (int y = pos1.y; y <= pos2.y; y++) { final boolean lx = x < pos2.x; diff --git a/src/main/java/com/intellectualcrafters/plot/util/Permissions.java b/src/main/java/com/intellectualcrafters/plot/util/Permissions.java index fc5af3478..28b1d912c 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/Permissions.java +++ b/src/main/java/com/intellectualcrafters/plot/util/Permissions.java @@ -53,7 +53,6 @@ public class Permissions { if (player.hasPermission(stub + ".*")) { return Integer.MAX_VALUE; } - System.out.print(range); for (int i = range; i > 0; i--) { if (player.hasPermission(stub + "." + i)) { return i; diff --git a/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java b/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java index 82fde8eb3..bde96af75 100644 --- a/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java +++ b/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java @@ -81,7 +81,6 @@ public class BukkitPlayer extends PlotPlayer { return EconHandler.manager.hasPermission(getName(), node); } boolean value = this.player.hasPermission(node); - System.out.print(value + " | " + node); if (Settings.PERMISSION_CACHING) { if (value) { this.hasPerm.add(node); diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index 0f5b3f867..b3ac72165 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ diff --git a/target/PlotSquared-Sponge.jar b/target/PlotSquared-Sponge.jar index 1017be70e..d5d7062c0 100644 Binary files a/target/PlotSquared-Sponge.jar and b/target/PlotSquared-Sponge.jar differ