diff --git a/src/main/java/com/massivecraft/factions/cmd/FCommand.java b/src/main/java/com/massivecraft/factions/cmd/FCommand.java index d5fef8cb..0d81676e 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FCommand.java @@ -50,7 +50,7 @@ public abstract class FCommand extends MCommand

{ if (this.actionPermission == null || this.fme == null) return false; if (!this.fme.isAdminBypassing()) { Access access = myFaction.getAccess(this.fme, this.actionPermission); - if (access == Access.DENY) { + if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) { return false; } } @@ -60,7 +60,7 @@ public abstract class FCommand extends MCommand

{ if (this.actionPermission == null || this.fme == null) return false; if (!this.fme.isAdminBypassing() && checkifAdmin) { Access access = myFaction.getAccess(this.fme, this.actionPermission); - if (access == Access.DENY) { + if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) { return false; } } @@ -70,7 +70,7 @@ public abstract class FCommand extends MCommand

{ if (this.permission == null || this.fme == null) return false; if (!this.fme.isAdminBypassing()) { Access access = myFaction.getAccess(this.fme, perm); - if (access == Access.DENY) { + if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) { return false; } } @@ -80,7 +80,7 @@ public abstract class FCommand extends MCommand

{ if (this.permission == null || this.fme == null) return false; if (!this.fme.isAdminBypassing() && checkifAdmin) { Access access = myFaction.getAccess(this.fme, perm); - if (access == Access.DENY) { + if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) { return false; } } diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java index fc0e514a..7fb0b14a 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -75,15 +75,13 @@ public class FactionsBlockListener implements Listener { return; } FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer()); - Faction faction = Board.getInstance().getFactionAt(new FLocation(event.getBlock().getLocation())); if (!fme.hasFaction()) { return; } if (event.getBlock().getType() == P.p.MOB_SPANWER) { if (!fme.isAdminBypassing()) { Access access = fme.getFaction().getAccess(fme, PermissableAction.SPAWNER); - // We don't want other factions to break blocks unless allowed - if (access == Access.DENY || (access != Access.ALLOW && fme.getFaction() != faction)) { + if (access != Access.ALLOW && fme.getRole() != Role.ADMIN) { fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "mine spawners"); return; } @@ -383,7 +381,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.DENY || (access != Access.ALLOW && me.getFaction() != otherFaction)) { + 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) { me.msg(TL.GENERIC_NOPERMISSION, action); diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 28568dbc..445bef56 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -311,11 +311,11 @@ public class FactionsPlayerListener implements Listener { } Access access = otherFaction.getAccess(me, action); - if (access == Access.DENY || (access != Access.ALLOW && me.getFaction() != otherFaction)) { + if (access != Access.ALLOW && me.getRole() != Role.ADMIN) { // TODO: Update this once new access values are added other than just allow / deny. - if ((myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && myFaction.isPlayerInOwnerList(me, loc))) { + if ((myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && myFaction.getOwnerListString(loc).contains(player.getName()))) { return true; - } else if (myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && !myFaction.isPlayerInOwnerList(me, loc)) { + } else if (myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && !myFaction.getOwnerListString(loc).contains(player.getName())) { me.msg("You can't " + action + " in this territory, it is owned by: " + myFaction.getOwnerListString(loc)); return false; } else if (access == Access.DENY) { @@ -441,14 +441,14 @@ public class FactionsPlayerListener implements Listener { } } } - // We might enable flight on player join just so he doesn't have to /f fly even if the ffly.AutoEnable option is enabled: - enableFly(me); + fallMap.put(me.getPlayer(), false); Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() { @Override public void run() { fallMap.remove(me.getPlayer()); + } }, 180L); @@ -532,7 +532,6 @@ public class FactionsPlayerListener implements Listener { } public void enableFly(FPlayer me) { - if (!P.p.getConfig().getBoolean("enable-faction-flight")) return; if (P.p.getConfig().getBoolean("ffly.AutoEnable")) { me.setFlying(true);