From 8ce33753f3f206c055e2bc087b96947f64e4061a Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 26 Apr 2015 16:32:05 +1000 Subject: [PATCH] Added WorldEdit bypass on join --- .../plot/listeners/PlayerEvents.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 2a074caa0..636e9e072 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -270,6 +270,11 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final StringWrapper name = new StringWrapper(username); final UUID uuid = pp.getUUID(); UUIDHandler.add(name, uuid); + if (PlotSquared.worldEdit != null) { + if (Permissions.hasPermission(pp, "plots.worldedit.bypass")) { + WEManager.bypass.add(pp.getName()); + } + } final Location loc = BukkitUtil.getLocation(player.getLocation()); final Plot plot = MainUtil.getPlot(loc); if (plot == null) { @@ -458,7 +463,12 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi public void onWorldChanged(final PlayerChangedWorldEvent event) { final PlotPlayer player = BukkitUtil.getPlayer(event.getPlayer()); if (PlotSquared.worldEdit != null) { - WEManager.bypass.remove(player.getName()); + if (!Permissions.hasPermission(player, "plots.worldedit.bypass")) { + WEManager.bypass.remove(player.getName()); + } + else { + WEManager.bypass.add(player.getName()); + } } ((BukkitPlayer) player).hasPerm = new HashSet<>(); ((BukkitPlayer) player).noPerm = new HashSet<>();