Allow falling block check during piston extend to be configurable

This commit is contained in:
Byteflux 2015-04-14 22:24:54 -07:00
parent 8bac9fe627
commit 75a499df0b
3 changed files with 9 additions and 0 deletions

View File

@ -801,6 +801,7 @@ public class PlotSquared {
options.put("confirmation.delete", Settings.CONFIRM_DELETE); options.put("confirmation.delete", Settings.CONFIRM_DELETE);
options.put("confirmation.unlink", Settings.CONFIRM_UNLINK); options.put("confirmation.unlink", Settings.CONFIRM_UNLINK);
options.put("protection.tnt-listener.enabled", Settings.TNT_LISTENER); 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("clusters.enabled", Settings.ENABLE_CLUSTERS);
options.put("clear.fastmode", Settings.ENABLE_CLUSTERS); options.put("clear.fastmode", Settings.ENABLE_CLUSTERS);
options.put("plotme-alias", Settings.USE_PLOTME_ALIAS); 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.CHUNK_PROCESSOR_MAX_ENTITIES= config.getInt("chunk-processor.max-entities");
Settings.TNT_LISTENER = config.getBoolean("protection.tnt-listener.enabled"); 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.PERMISSION_CACHING = config.getBoolean("cache.permissions");
Settings.CONFIRM_CLEAR = config.getBoolean("confirmation.clear"); Settings.CONFIRM_CLEAR = config.getBoolean("confirmation.clear");
Settings.CONFIRM_DELETE = config.getBoolean("confirmation.delete"); Settings.CONFIRM_DELETE = config.getBoolean("confirmation.delete");

View File

@ -55,6 +55,10 @@ public class Settings {
* TNT listener * TNT listener
*/ */
public static boolean TNT_LISTENER = false; 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 * Max auto claiming size
*/ */

View File

@ -672,6 +672,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
return; return;
} }
} }
if (!Settings.PISTON_FALLING_BLOCK_CHECK) {
return;
}
org.bukkit.Location lastLoc; org.bukkit.Location lastLoc;
if (blocks.size() > 0) { if (blocks.size() > 0) {
lastLoc = blocks.get(blocks.size() - 1).getLocation().add(relative); lastLoc = blocks.get(blocks.size() - 1).getLocation().add(relative);