From 75a499df0b39de6391e87f76e2ddd03b1f66934a Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 14 Apr 2015 22:24:54 -0700 Subject: [PATCH] Allow falling block check during piston extend to be configurable --- .../main/java/com/intellectualcrafters/plot/PlotSquared.java | 2 ++ .../java/com/intellectualcrafters/plot/config/Settings.java | 4 ++++ .../com/intellectualcrafters/plot/listeners/PlayerEvents.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index 7b4d09ce6..0d7ad5464 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -801,6 +801,7 @@ public class PlotSquared { options.put("confirmation.delete", Settings.CONFIRM_DELETE); options.put("confirmation.unlink", Settings.CONFIRM_UNLINK); options.put("protection.tnt-listener.enabled", Settings.TNT_LISTENER); + options.put("protection.piston.falling-blocks", Settings.PISTON_FALLING_BLOCK_CHECK); options.put("clusters.enabled", Settings.ENABLE_CLUSTERS); options.put("clear.fastmode", Settings.ENABLE_CLUSTERS); options.put("plotme-alias", Settings.USE_PLOTME_ALIAS); @@ -846,6 +847,7 @@ public class PlotSquared { Settings.CHUNK_PROCESSOR_MAX_ENTITIES= config.getInt("chunk-processor.max-entities"); Settings.TNT_LISTENER = config.getBoolean("protection.tnt-listener.enabled"); + Settings.PISTON_FALLING_BLOCK_CHECK = config.getBoolean("protection.piston.falling-blocks"); Settings.PERMISSION_CACHING = config.getBoolean("cache.permissions"); Settings.CONFIRM_CLEAR = config.getBoolean("confirmation.clear"); Settings.CONFIRM_DELETE = config.getBoolean("confirmation.delete"); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java index baf6b6e09..57395be97 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java @@ -55,6 +55,10 @@ public class Settings { * TNT listener */ public static boolean TNT_LISTENER = false; + /** + * Check for falling blocks when pistons extend? + */ + public static boolean PISTON_FALLING_BLOCK_CHECK = true; /** * Max auto claiming size */ 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 e733c916b..d0e380d0c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -672,6 +672,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } } + if (!Settings.PISTON_FALLING_BLOCK_CHECK) { + return; + } org.bukkit.Location lastLoc; if (blocks.size() > 0) { lastLoc = blocks.get(blocks.size() - 1).getLocation().add(relative);