mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-23 18:55:25 +01:00
fix for pistons not working (via pistonProtectionThroughDenyBuild) if faction doesn't have build rights in its own territory
This commit is contained in:
parent
56cb2becde
commit
619e52a5d4
@ -129,8 +129,11 @@ 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);
|
||||
|
||||
// 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(targetBlock));
|
||||
if (targetFaction == pistonFaction) return;
|
||||
|
||||
// if potentially pushing into air in another territory, we need to check it out
|
||||
|
||||
if (targetBlock.isEmpty() && ! FPerm.BUILD.has(pistonFaction, targetBlock.getLocation()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user