From 1e9cf01e23e0fc9185e62243209191c8473c2a2c Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 11 Nov 2012 13:05:59 -0600 Subject: [PATCH] Fix for pistons being able to push blocks into protected territory through water or lava --- .../factions/listeners/FactionsBlockListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java index ddc535b7..1be12c52 100644 --- a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -82,8 +82,8 @@ public class FactionsBlockListener implements Listener // target end-of-the-line empty (air) block which is being pushed into, including if piston itself would extend into air Block targetBlock = event.getBlock().getRelative(event.getDirection(), event.getLength() + 1); - // if potentially pushing into air in another territory, we need to check it out - if (targetBlock.isEmpty() && !canPistonMoveBlock(pistonFaction, targetBlock.getLocation())) + // if potentially pushing into air/water/lava in another territory, we need to check it out + if ((targetBlock.isEmpty() || targetBlock.isLiquid()) && !canPistonMoveBlock(pistonFaction, targetBlock.getLocation())) { event.setCancelled(true); return; @@ -107,8 +107,8 @@ public class FactionsBlockListener implements Listener Location targetLoc = event.getRetractLocation(); - // if potentially retracted block is just air, no worries - if (targetLoc.getBlock().isEmpty()) + // if potentially retracted block is just air/water/lava, no worries + if (targetLoc.getBlock().isEmpty() || targetLoc.getBlock().isLiquid()) { return; }