diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java b/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java index 8732ff782..4b1d1c424 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java @@ -20,13 +20,10 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// package com.intellectualcrafters.plot.commands; -import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer; -import com.intellectualcrafters.plot.object.PlotWorld; -import com.intellectualcrafters.plot.util.EconHandler; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; import com.plotsquared.general.commands.CommandDeclaration; @@ -34,7 +31,12 @@ import com.plotsquared.general.commands.CommandDeclaration; /** * Unclaiming a plot makes no changes to the terrain or plot border and only removes the owner and should be regarded as an admin command. */ -@CommandDeclaration(command = "unclaim", usage = "/plot unclaim", requiredType = RequiredType.NONE, description = "Unclaim a plot (admin command)", category = CommandCategory.ACTIONS) +@CommandDeclaration( +command = "unclaim", +usage = "/plot unclaim", +requiredType = RequiredType.NONE, +description = "Unclaim a plot (admin command/does not clear plot)", +category = CommandCategory.ACTIONS) public class Unclaim extends SubCommand { @Override diff --git a/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/src/main/java/com/intellectualcrafters/plot/object/Plot.java index 7e5ff65d4..95f740380 100644 --- a/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -22,7 +22,6 @@ package com.intellectualcrafters.plot.object; import java.io.File; import java.net.URL; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -39,7 +38,6 @@ import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.flag.Flag; import com.intellectualcrafters.plot.flag.FlagManager; -import com.intellectualcrafters.plot.object.comment.PlotComment; import com.intellectualcrafters.plot.util.BO3Handler; import com.intellectualcrafters.plot.util.BlockManager; import com.intellectualcrafters.plot.util.ChunkManager; @@ -982,11 +980,7 @@ public class Plot { * @param uuid */ public boolean removeDenied(final UUID uuid) { - if (getDenied().remove(uuid)) { - DBFunc.removeDenied(this, uuid); - return true; - } - return false; + return PlotHandler.removeDenied(this, uuid); } /** @@ -995,11 +989,7 @@ public class Plot { * @param uuid */ public boolean removeTrusted(final UUID uuid) { - if (getTrusted().remove(uuid)) { - DBFunc.removeTrusted(this, uuid); - return true; - } - return false; + return PlotHandler.removeTrusted(this, uuid); } /** @@ -1008,11 +998,7 @@ public class Plot { * @param uuid */ public boolean removeMember(final UUID uuid) { - if (getMembers().remove(uuid)) { - DBFunc.removeMember(this, uuid); - return true; - } - return false; + return PlotHandler.removeMember(this, uuid); } /** diff --git a/src/main/java/com/intellectualcrafters/plot/object/PlotHandler.java b/src/main/java/com/intellectualcrafters/plot/object/PlotHandler.java index ae5bd17a5..f0f13ea72 100644 --- a/src/main/java/com/intellectualcrafters/plot/object/PlotHandler.java +++ b/src/main/java/com/intellectualcrafters/plot/object/PlotHandler.java @@ -198,6 +198,39 @@ public class PlotHandler { } } } + + public static boolean removeDenied(Plot plot, UUID uuid) { + for (Plot current : MainUtil.getConnectedPlots(plot)) { + if (current.getDenied().remove(uuid)) { + DBFunc.removeDenied(current, uuid); + } else { + return false; + } + } + return true; + } + + public static boolean removeMember(Plot plot, UUID uuid) { + for (Plot current : MainUtil.getConnectedPlots(plot)) { + if (current.getMembers().remove(uuid)) { + DBFunc.removeMember(current, uuid); + } else { + return false; + } + } + return true; + } + + public static boolean removeTrusted(Plot plot, UUID uuid) { + for (Plot current : MainUtil.getConnectedPlots(plot)) { + if (current.getTrusted().remove(uuid)) { + DBFunc.removeTrusted(current, uuid); + } else { + return false; + } + } + return true; + } public static boolean unclaim(Plot plot) { if (plot.owner == null) { diff --git a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java index 243a838c1..66e256a9b 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java +++ b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java @@ -243,7 +243,6 @@ public abstract class SchematicHandler { case 20: case 21: case 22: - case 24: case 30: case 32: case 37: diff --git a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 84f0ea9cd..3354d3882 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -625,7 +625,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen event.setFormat(format); } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void BlockDestroy(final BlockBreakEvent event) { final Player player = event.getPlayer(); final String world = player.getWorld().getName(); @@ -1040,7 +1040,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen } } - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onInteract(final PlayerInteractEvent event) { final Action action = event.getAction(); final Block block = event.getClickedBlock(); diff --git a/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java b/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java index b5368193e..62168d56f 100644 --- a/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -31,6 +31,7 @@ import com.intellectualcrafters.plot.util.BlockManager; import com.intellectualcrafters.plot.util.MathMan; import com.intellectualcrafters.plot.util.StringComparison; import com.intellectualcrafters.plot.util.StringMan; +import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.bukkit.object.BukkitPlayer; @@ -215,10 +216,15 @@ public class BukkitUtil extends BlockManager { block.setTypeIdAndData(Material.WALL_SIGN.getId(), (byte) 2, false); final BlockState blockstate = block.getState(); if ((blockstate instanceof Sign)) { - for (int i = 0; i < lines.length; i++) { - ((Sign) blockstate).setLine(i, lines[i]); - } - ((Sign) blockstate).update(true); + TaskManager.runTaskLater(new Runnable() { + @Override + public void run() { + for (int i = 0; i < lines.length; i++) { + ((Sign) blockstate).setLine(i, lines[i]); + } + ((Sign) blockstate).update(true); + } + }, 1); } } diff --git a/src/main/java/com/plotsquared/bukkit/util/SetBlockFast_1_8.java b/src/main/java/com/plotsquared/bukkit/util/SetBlockFast_1_8.java index 04730cb63..b507d7d18 100644 --- a/src/main/java/com/plotsquared/bukkit/util/SetBlockFast_1_8.java +++ b/src/main/java/com/plotsquared/bukkit/util/SetBlockFast_1_8.java @@ -194,7 +194,6 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager { case 20: case 21: case 22: - case 24: case 25: case 30: case 32: diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index 3121bb78b..63489c6e3 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ