Add option to completely disable pistons in faction territory.

This is a preemptive method to block new things like http://i.gyazo.com/6a1a31222e58a5d60ff341c13f6a8404.gif
This commit is contained in:
drtshock
2014-11-08 19:07:42 -06:00
parent ccd8720b09
commit 81182dccaa
2 changed files with 12 additions and 0 deletions

View File

@@ -98,6 +98,13 @@ public class FactionsBlockListener implements Listener {
}
Location targetLoc = event.getRetractLocation();
Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(targetLoc));
// Check if the piston is moving in a faction's territory. This disables pistons entirely in faction territory.
if(otherFaction.isNormal() && P.p.getConfig().getBoolean("disable-pistons-in-territory", false)) {
event.setCancelled(true);
return;
}
// if potentially retracted block is just air/water/lava, no worries
if (targetLoc.getBlock().isEmpty() || targetLoc.getBlock().isLiquid()) {