From c9c669a8c211f87ee94170cbee7f12eaf6033db2 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 9 May 2015 13:38:40 +1000 Subject: [PATCH] UUID caching + Interact event Fixed an issue where UUID handler would not recognize * as the "everyone uuid" if it took the shortcut for faster UUID caching. Fixed #301 an issue with fire protection (Bukkit has a strange way of dealing with this) --- .../plot/listeners/PlayerEvents.java | 9 +++------ .../plot/util/bukkit/UUIDHandler.java | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 919bf21c9..8e8fdf2ae 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -759,9 +759,6 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onInteract(final PlayerInteractEvent event) { Action action = event.getAction(); - if (action == Action.LEFT_CLICK_BLOCK) { - return; - } final Block block = event.getClickedBlock(); if (block == null) { return; @@ -780,7 +777,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (Permissions.hasPermission(pp, "plots.admin.interact.unowned")) { return; } - if (action != Action.PHYSICAL) { + if (action != Action.PHYSICAL && action != Action.LEFT_CLICK_BLOCK) { MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.unowned"); } event.setCancelled(true); @@ -795,7 +792,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (Permissions.hasPermission(pp, "plots.admin.interact.other")) { return; } - if (action != Action.PHYSICAL) { + if (action != Action.PHYSICAL && action != Action.LEFT_CLICK_BLOCK) { MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.other"); } event.setCancelled(true); @@ -808,7 +805,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (MainUtil.isPlotArea(loc)) { - if (action != Action.PHYSICAL) { + if (action != Action.PHYSICAL && action != Action.LEFT_CLICK_BLOCK) { MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.road"); } event.setCancelled(true); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java index b3fbcdcdb..9cc2bcebc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java @@ -136,6 +136,7 @@ public class UUIDHandler { } } } + add(new StringWrapper("*"), DBFunc.everyone); PlotSquared.log(C.PREFIX.s() + "&6Cached a total of: " + UUIDHandler.uuidMap.size() + " UUIDs"); return; }