Combined if statements in flycheck.

This commit is contained in:
ProSavage 2019-04-05 10:33:36 -05:00
parent ec830f1dc0
commit e77582de8d

View File

@ -15,7 +15,6 @@ import org.bukkit.Particle;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.ConcurrentModificationException;
import java.util.List; import java.util.List;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -93,22 +92,13 @@ public class CmdFly extends FCommand {
continue; continue;
} }
Player player = Bukkit.getPlayer(name); Player player = Bukkit.getPlayer(name);
if (player == null) { if (player == null
continue; || !player.isFlying()
} || player.getGameMode() == GameMode.CREATIVE
if (!player.isFlying()) { || !SavageFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
continue; continue;
} }
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player); FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (fPlayer == null) {
continue;
}
if (player.getGameMode() == GameMode.CREATIVE) {
continue;
}
if (!SavageFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
continue;
}
Faction myFaction = fPlayer.getFaction(); Faction myFaction = fPlayer.getFaction();
if (myFaction.isWilderness()) { if (myFaction.isWilderness()) {
fPlayer.setFlying(false); fPlayer.setFlying(false);
@ -119,12 +109,10 @@ public class CmdFly extends FCommand {
continue; continue;
} }
FLocation myFloc = new FLocation(player.getLocation()); FLocation myFloc = new FLocation(player.getLocation());
Faction toFac = Board.getInstance().getFactionAt(myFloc);
if (Board.getInstance().getFactionAt(myFloc) != myFaction) { if (Board.getInstance().getFactionAt(myFloc) != myFaction) {
if (!checkBypassPerms(fPlayer, player, toFac)) { if (!checkBypassPerms(fPlayer, player, Board.getInstance().getFactionAt(myFloc))) {
fPlayer.setFlying(false); fPlayer.setFlying(false);
flyMap.remove(name); flyMap.remove(name);
continue;
} }
} }