diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFly.java b/src/main/java/com/massivecraft/factions/cmd/CmdFly.java index 4e696e48..d3d54af7 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFly.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFly.java @@ -59,31 +59,31 @@ public class CmdFly extends FCommand { }, 10L, 3L); } - public static boolean checkBypassPerms(FPlayer fme, Player me, Faction toFac) { + public static boolean checkBypassPerms(FPlayer fme, Player me, Faction toFac, boolean sendMessage) { if (Conf.denyFlightIfInNoClaimingWorld && !Conf.worldsNoClaiming.isEmpty() && Conf.worldsNoClaiming.stream().anyMatch(me.getWorld().getName()::equalsIgnoreCase)) return false; if (toFac != fme.getFaction()) { if (!me.hasPermission(Permission.FLY_WILDERNESS.node) && toFac.isWilderness() || !me.hasPermission(Permission.FLY_SAFEZONE.node) && toFac.isSafeZone() || !me.hasPermission(Permission.FLY_WARZONE.node) && toFac.isWarZone()) { - fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); + if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); return false; } Access access = toFac.getAccess(fme, PermissableAction.FLY); if ((!(me.hasPermission(Permission.FLY_ENEMY.node) || access == Access.ALLOW)) && toFac.getRelationTo(fme.getFaction()) == Relation.ENEMY) { - fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); + if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); return false; } if (!(me.hasPermission(Permission.FLY_ALLY.node) || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.ALLY) { - fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); + if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); return false; } if (!(me.hasPermission(Permission.FLY_TRUCE.node) || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.TRUCE) { - fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); + if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); return false; } if (!(me.hasPermission(Permission.FLY_NEUTRAL.node) || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.NEUTRAL && !toFac.isSystemFaction()) { - fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); + if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme)); return false; } return me.hasPermission(Permission.FLY_FLY.node) && (access != Access.DENY || toFac.isSystemFaction()); @@ -121,7 +121,7 @@ public class CmdFly extends FCommand { FLocation myfloc = new FLocation(context.player.getLocation()); Faction toFac = Board.getInstance().getFactionAt(myfloc); - if (!checkBypassPerms(context.fPlayer, context.player, toFac)) { + if (!checkBypassPerms(context.fPlayer, context.player, toFac, false)) { context.fPlayer.sendMessage(TL.COMMAND_FLY_NO_ACCESS.format(toFac.getTag())); return; } diff --git a/src/main/java/com/massivecraft/factions/cmd/claim/CmdClaim.java b/src/main/java/com/massivecraft/factions/cmd/claim/CmdClaim.java index 46b5060d..c80f91d2 100644 --- a/src/main/java/com/massivecraft/factions/cmd/claim/CmdClaim.java +++ b/src/main/java/com/massivecraft/factions/cmd/claim/CmdClaim.java @@ -59,7 +59,7 @@ public class CmdClaim extends FCommand { Faction at = Board.getInstance().getFactionAt(new FLocation(context.fPlayer.getPlayer().getLocation())); if (radius < 2) { - if (FactionsPlugin.cachedRadiusClaim && context.fPlayer.attemptClaim(forFaction, context.player.getLocation(), true)) { + if (FactionsPlugin.cachedRadiusClaim && context.fPlayer.attemptClaim(forFaction, context.player.getLocation(), false)) { context.fPlayer.getFaction().getFPlayersWhereOnline(true).forEach(f -> f.msg(TL.CLAIM_CLAIMED, context.fPlayer.describeTo(f, true), context.fPlayer.getFaction().describeTo(f), at.describeTo(f))); FactionsPlugin.instance.logFactionEvent(forFaction, FLogType.CHUNK_CLAIMS, context.fPlayer.getName(), CC.GreenB + "CLAIMED", "1", (new FLocation(context.fPlayer.getPlayer().getLocation())).formatXAndZ(",")); return; diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java index 3e49e48e..1b875826 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java @@ -1022,7 +1022,7 @@ public abstract class MemoryFPlayer implements FPlayer { } if (faction.isSystemFaction()) { - return CmdFly.checkBypassPerms(this, getPlayer(), faction); + return CmdFly.checkBypassPerms(this, getPlayer(), faction, false); } Access access = faction.getAccess(this, PermissableAction.FLY);