From 6cc744a2e61b7b25518a88f25228c99147ff2124 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 2 Dec 2016 17:15:18 +1100 Subject: [PATCH] Fixes #1444 --- .../bukkit/listeners/PlayerEvents.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 b8dac6c89..82cd1e877 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -22,6 +22,7 @@ import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.RegExUtil; import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.UUIDHandler; +import com.plotsquared.bukkit.BukkitMain; import com.plotsquared.bukkit.object.BukkitLazyBlock; import com.plotsquared.bukkit.object.BukkitPlayer; import com.plotsquared.bukkit.util.BukkitUtil; @@ -364,14 +365,32 @@ public class PlayerEvents extends PlotListener implements Listener { } Player player = event.getPlayer(); PlotPlayer pp = BukkitUtil.getPlayer(player); + Location loc = pp.getLocation(); + PlotArea area = loc.getPlotArea(); + if (area == null) { + return; + } + String[] parts = msg.split(" "); Plot plot = pp.getCurrentPlot(); + System.out.println(parts[0]); + if (BukkitMain.worldEdit != null) { // Check WorldEdit + switch (parts[0].toLowerCase()) { + case "up": + case "/up": + case "worldedit:up": + case "worldedit:/up": + if (plot == null || (!plot.isAdded(pp.getUUID()) && Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER, true))) { + event.setCancelled(true); + return; + } + } + } if (plot == null) { return; } Optional> flag = plot.getFlag(Flags.BLOCKED_CMDS); if (flag.isPresent() && !Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) { List blocked_cmds = flag.get(); - String[] parts = msg.split(" "); String c = parts[0]; if (parts[0].contains(":")) { c = parts[0].split(":")[1];