From 712ce74af6f60de546241bccb241245d39d6ba05 Mon Sep 17 00:00:00 2001 From: zomb Date: Sun, 20 Mar 2016 00:26:45 -1000 Subject: [PATCH] /p weanywhere change Allows players with "WorldEdit Anywhere" toggled to use the wand anywhere --- .../com/plotsquared/bukkit/listeners/PlayerEvents.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 40ca9a4fa..5e4d81812 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -615,6 +615,11 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_DESTROY_ROAD)) { return; } + if (PS.get().worldedit != null && pp.getAttribute("worldedit")) { + if (player.getItemInHand().getTypeId() == PS.get().worldedit.getConfiguration().wandItem) { + return; + } + } MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_DESTROY_ROAD); event.setCancelled(true); } @@ -1165,6 +1170,11 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen default: return; } + if (PS.get().worldedit != null && pp.getAttribute("worldedit")) { + if (player.getItemInHand().getTypeId() == PS.get().worldedit.getConfiguration().wandItem) { + return; + } + } if (!EventUtil.manager.checkPlayerBlockEvent(pp, eventType, loc, lb, true)) { event.setCancelled(true); }