Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 705a370

Browse files
committed
Build/Destroy permission fixed ( relationally )
1 parent 38db648 commit 705a370

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ public static boolean playerCanBuildDestroyBlock(Player player, Location locatio
344344
boolean pain = !justCheck && rel.confPainBuild(online);
345345
boolean deny = rel.confDenyBuild(online);
346346

347+
Access access = otherFaction.getAccess(me, PermissableAction.fromString(action));
348+
if (access == Access.ALLOW && ((rel == Relation.ALLY) || (rel == Relation.ENEMY) || (rel == Relation.NEUTRAL) || (rel == Relation.TRUCE))) {
349+
deny = false;
350+
}
347351
// hurt the player for building/destroying in other territory?
348352
if (pain) {
349353
player.damage(Conf.actionDeniedPainAmount);
@@ -380,7 +384,7 @@ public static boolean playerCanBuildDestroyBlock(Player player, Location locatio
380384
}
381385

382386
// Check the permission just after making sure the land isn't owned by someone else to avoid bypass.
383-
Access access = otherFaction.getAccess(me, PermissableAction.fromString(action));
387+
384388
if (access != Access.ALLOW && me.getRole() != Role.ADMIN) {
385389
// TODO: Update this once new access values are added other than just allow / deny.
386390
if (access == Access.DENY) {

0 commit comments

Comments
 (0)