From 705a370d3139121f11a260ec50086289ca67ee3c Mon Sep 17 00:00:00 2001 From: ProSavage Date: Wed, 17 Oct 2018 16:05:26 -0500 Subject: [PATCH] Build/Destroy permission fixed ( relationally ) --- .../factions/listeners/FactionsBlockListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java index 7fb0b14a..8ae67aa5 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -344,6 +344,10 @@ public class FactionsBlockListener implements Listener { boolean pain = !justCheck && rel.confPainBuild(online); boolean deny = rel.confDenyBuild(online); + Access access = otherFaction.getAccess(me, PermissableAction.fromString(action)); + if (access == Access.ALLOW && ((rel == Relation.ALLY) || (rel == Relation.ENEMY) || (rel == Relation.NEUTRAL) || (rel == Relation.TRUCE))) { + deny = false; + } // hurt the player for building/destroying in other territory? if (pain) { player.damage(Conf.actionDeniedPainAmount); @@ -380,7 +384,7 @@ public class FactionsBlockListener implements Listener { } // Check the permission just after making sure the land isn't owned by someone else to avoid bypass. - Access access = otherFaction.getAccess(me, PermissableAction.fromString(action)); + if (access != Access.ALLOW && me.getRole() != Role.ADMIN) { // TODO: Update this once new access values are added other than just allow / deny. if (access == Access.DENY) {