diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java index 1666968da..7539ad60f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -89,7 +89,7 @@ public enum C { WORLDEDIT_VOLUME("$2You cannot select a volume of %current%. The maximum volume you can modify is %max%."), WORLDEDIT_ITERATIONS("$2You cannot iterate %current% times. The maximum number of iterations allowed is %max%."), WORLDEDIT_UNSAFE("$2Access to that command has been blocked"), - WORLDEDIT_BYPASS("$2&oTo bypass your restrictions use $3/plot wea"), + WORLDEDIT_BYPASS("$2&oTo bypass your restrictions use $4/plot wea"), WORLDEDIT_UNMASKED("$1Your WorldEdit is now unrestricted."), WORLDEDIT_RESTRICTED("$1Your WorldEdit is now restricted."), /* diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java index cf100dd69..a1182c30d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/worldedit/WEListener.java @@ -118,15 +118,16 @@ public class WEListener implements Listener { final BlockVector pos1 = selection.getNativeMinimumPoint().toBlockVector(); final BlockVector pos2 = selection.getNativeMaximumPoint().toBlockVector(); HashSet mask = WEManager.getMask(pp); + RegionWrapper region = new RegionWrapper(pos1.getBlockX(), pos2.getBlockX(), pos1.getBlockZ(), pos2.getBlockZ()); if (Settings.REQUIRE_SELECTION) { String arg = null; - if (mask.size() == 0) { + if (!WEManager.regionContains(region, mask)) { arg = "pos1 + pos2"; } - if (!WEManager.maskContains(mask, pos1.getBlockX(), pos1.getBlockZ())) { + else if (!WEManager.maskContains(mask, pos1.getBlockX(), pos1.getBlockZ())) { arg = "pos1"; } - if (!WEManager.maskContains(mask, pos2.getBlockX(), pos2.getBlockZ())) { + else if (!WEManager.maskContains(mask, pos2.getBlockX(), pos2.getBlockZ())) { arg = "pos2"; } if (arg != null) { @@ -138,7 +139,6 @@ public class WEListener implements Listener { return true; } } - RegionWrapper region = new RegionWrapper(pos1.getBlockX(), pos2.getBlockX(), pos1.getBlockZ(), pos2.getBlockZ()); if (!WEManager.regionContains(region, mask)) { MainUtil.sendMessage(pp, C.REQUIRE_SELECTION_IN_MASK, "pos1 + pos2"); e.setCancelled(true); @@ -155,7 +155,7 @@ public class WEListener implements Listener { public boolean onPlayerCommand(final PlayerCommandPreprocessEvent e) { final Player p = e.getPlayer(); final PlotPlayer pp = BukkitUtil.getPlayer(p); - if (!PlotSquared.isPlotWorld(p.getWorld().getName()) || Permissions.hasPermission(pp, "plots.worldedit.bypass")) { + if (!PlotSquared.isPlotWorld(p.getWorld().getName())) { return true; } String cmd = e.getMessage().toLowerCase();