Merge pull request #111 from Stefan923/1.6.x

Fixed AutoFly issue
This commit is contained in:
Driftay 2020-05-08 20:22:33 -04:00 committed by GitHub
commit e2d85d83f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -580,7 +580,7 @@ public class FactionsPlayerListener implements Listener {
}
public void checkCanFly(FPlayer me) {
if (me.isFlying() && (!me.canFlyAtLocation() || me.checkIfNearbyEnemies())) {
if (!me.canFlyAtLocation() || me.checkIfNearbyEnemies()) {
me.setFFlying(false, false);
return;
}
@ -662,9 +662,11 @@ public class FactionsPlayerListener implements Listener {
if (lastLocations.isEmpty()) return;
for (Map.Entry<UUID, Location> check : lastLocations.entrySet()) {
Player player = Bukkit.getPlayer(check.getKey());
if (player != null) {
refreshPosition(player, check.getValue(), player.getLocation());
lastLocations.put(player.getUniqueId(), player.getLocation());
}
}
}, 5L, 10L);
}