Small change to fly

This commit is contained in:
DroppingAnvil 2020-04-04 18:42:38 -05:00 committed by droppinganvil
parent 5cf21d479e
commit 5809387df2
1 changed files with 2 additions and 3 deletions

View File

@ -79,11 +79,11 @@ public class CmdFly extends FCommand {
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player); FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (fPlayer.isAdminBypassing()) continue; if (fPlayer.isAdminBypassing()) continue;
if (!player.hasPermission("factions.fly.bypassnearbyenemycheck")) { if (!player.hasPermission("factions.fly.bypassnearbyenemycheck")) {
checkEnemiesSync(fPlayer);
if (fPlayer.hasEnemiesNearby()) { if (fPlayer.hasEnemiesNearby()) {
disableFlightSync(fPlayer); disableFlightSync(fPlayer);
continue; continue;
} }
checkEnemiesSync(fPlayer);
} }
FLocation myFloc = new FLocation(player.getLocation()); FLocation myFloc = new FLocation(player.getLocation());
if (!checkFly(fPlayer, player, Board.getInstance().getFactionAt(myFloc))) { if (!checkFly(fPlayer, player, Board.getInstance().getFactionAt(myFloc))) {
@ -93,11 +93,10 @@ public class CmdFly extends FCommand {
} }
} }
}, 20L, 20L); }, 20L, 15L);
} }
public static boolean checkFly(FPlayer fme, Player me, Faction toFac) { public static boolean checkFly(FPlayer fme, Player me, Faction toFac) {
System.out.print("Checking user " + me.getName());
if (Conf.denyFlightIfInNoClaimingWorld && !Conf.worldsNoClaiming.isEmpty() && Conf.worldsNoClaiming.stream().anyMatch(me.getWorld().getName()::equalsIgnoreCase)) if (Conf.denyFlightIfInNoClaimingWorld && !Conf.worldsNoClaiming.isEmpty() && Conf.worldsNoClaiming.stream().anyMatch(me.getWorld().getName()::equalsIgnoreCase))
return false; return false;
if (toFac.getAccess(fme, PermissableAction.FLY) == Access.ALLOW) return true; if (toFac.getAccess(fme, PermissableAction.FLY) == Access.ALLOW) return true;