From 95289e1411ca06ce4a12fd6989947ceeb6c33d16 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 9 Nov 2012 17:47:53 -0600 Subject: [PATCH] fix for piston retraction not working if faction doesn't have build rights in its own territory; missed this when fixing the same thing for piston extension recently --- .../factions/listeners/FactionsBlockListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java index b3563961..7981fc97 100644 --- a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -158,7 +158,11 @@ public class FactionsBlockListener implements Listener if (targetLoc.getBlock().isEmpty()) return; Faction pistonFaction = Board.getFactionAt(new FLocation(event.getBlock())); - + + // members of faction might not have build rights in their own territory, but pistons should still work regardless; so, address that corner case + Faction targetFaction = Board.getFactionAt(new FLocation(targetLoc)); + if (targetFaction == pistonFaction) return; + if ( ! FPerm.BUILD.has(pistonFaction, targetLoc)) { event.setCancelled(true);