From 7bd99afa25ec7ac4a28ad2223b140c14400a6c21 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 22 Feb 2015 00:36:57 +1100 Subject: [PATCH] WEL --- .../plot/listeners/WorldEditListener.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java index 4aa9d4f4b..4741b631b 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java @@ -106,10 +106,11 @@ public class WorldEditListener implements Listener { if ((p.getItemInHand() == null) || (p.getItemInHand().getType() == Material.AIR)) { return; } - com.intellectualcrafters.plot.object.Location loc = BukkitUtil.getLocation(b.getLocation()); + PlotPlayer pp = BukkitUtil.getPlayer(p); + com.intellectualcrafters.plot.object.Location loc = pp.getLocation(); final Plot plot = MainUtil.getPlot(loc); if (plot != null) { - if (plot.hasOwner() && (plot.helpers != null) && (plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(UUIDHandler.getUUID(p)))) { + if (plot.hasOwner() && (plot.helpers != null) && (plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(pp.getUUID()))) { PWE.setMask(BukkitUtil.getPlayer(p), loc, false); } } @@ -127,8 +128,8 @@ public class WorldEditListener implements Listener { cmd = cmd.substring(0, cmd.indexOf(" ")); } if (this.restrictedcmds.contains(cmd)) { - final Plot plot = MainUtil.getPlot(BukkitUtil.getLocation(p)); - if ((plot == null) || !(plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(UUIDHandler.getUUID(p)))) { + final Plot plot = MainUtil.getPlot(pp.getLocation()); + if ((plot == null) || !(plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(pp.getUUID()))) { e.setCancelled(true); } return; @@ -194,7 +195,7 @@ public class WorldEditListener implements Listener { final Player p = e.getPlayer(); PlotPlayer pp = BukkitUtil.getPlayer(p); if (Permissions.hasPermission(pp, "plots.worldedit.bypass")) { - if (!PWE.hasMask(p)) { + if (!PWE.hasMask(pp)) { return; } } @@ -237,7 +238,7 @@ public class WorldEditListener implements Listener { final Player p = e.getPlayer(); PlotPlayer pp = BukkitUtil.getPlayer(p); if (Permissions.hasPermission(pp, "plots.worldedit.bypass")) { - if (!PWE.hasMask(p)) { + if (!PWE.hasMask(pp)) { return; } }