This commit is contained in:
Jesse Boyd 2016-12-02 17:15:18 +11:00
parent e40dc37f89
commit 6cc744a2e6
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -22,6 +22,7 @@ import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.RegExUtil; import com.intellectualcrafters.plot.util.RegExUtil;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.BukkitMain;
import com.plotsquared.bukkit.object.BukkitLazyBlock; import com.plotsquared.bukkit.object.BukkitLazyBlock;
import com.plotsquared.bukkit.object.BukkitPlayer; import com.plotsquared.bukkit.object.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.BukkitUtil;
@ -364,14 +365,32 @@ public class PlayerEvents extends PlotListener implements Listener {
} }
Player player = event.getPlayer(); Player player = event.getPlayer();
PlotPlayer pp = BukkitUtil.getPlayer(player); 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(); 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) { if (plot == null) {
return; return;
} }
Optional<List<String>> flag = plot.getFlag(Flags.BLOCKED_CMDS); Optional<List<String>> flag = plot.getFlag(Flags.BLOCKED_CMDS);
if (flag.isPresent() && !Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) { if (flag.isPresent() && !Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
List<String> blocked_cmds = flag.get(); List<String> blocked_cmds = flag.get();
String[] parts = msg.split(" ");
String c = parts[0]; String c = parts[0];
if (parts[0].contains(":")) { if (parts[0].contains(":")) {
c = parts[0].split(":")[1]; c = parts[0].split(":")[1];