From c4d84bb0708a5ace9e58d8790d31a7130766cd5e Mon Sep 17 00:00:00 2001 From: boy0001 Date: Mon, 2 Feb 2015 11:52:48 +1100 Subject: [PATCH] check if clusters are enables --- .../intellectualcrafters/plot/listeners/PlayerEvents.java | 6 +++--- .../intellectualcrafters/plot/listeners/PlotListener.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 cd6f69872..0a5685b78 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -248,12 +248,12 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } Player player = event.getPlayer(); Location loc = event.getBlock().getLocation(); - if (isInPlot(loc)) { + final Plot plot = getCurrentPlot(loc); + if (plot != null) { if (event.getBlock().getY() == 0) { event.setCancelled(true); return; } - final Plot plot = getCurrentPlot(loc); if (!plot.hasOwner()) { if (PlotMain.hasPermission(player, "plots.admin.destroy.unowned")) { return; @@ -278,7 +278,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (PlotMain.hasPermission(event.getPlayer(), "plots.admin.destroy.road")) { return; } - if (isPlotArea(loc)) { + if (isPlotArea(loc)) { PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.road"); event.setCancelled(true); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java index 38fadd21f..366b0f318 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java @@ -91,7 +91,7 @@ import com.sk89q.worldguard.protection.flags.BooleanFlag; public static boolean isPlotArea(Location location) { PlotWorld plotworld = PlotMain.getWorldSettings(location.getWorld()); - if (plotworld.REQUIRE_CLUSTER) { + if (Settings.ENABLE_CLUSTERS && plotworld.REQUIRE_CLUSTER) { return ClusterManager.getCluster(location) != null; } return true;