Fly-Command #18
@ -43,7 +43,7 @@ public class FlyCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player);
|
||||
boolean newFlightState = !lobbyPlayer.isFly();
|
||||
boolean newFlightState = !lobbyPlayer.hasFly();
|
||||
|
||||
lobbyPlayer.setFly(newFlightState);
|
||||
player.setAllowFlight(newFlightState);
|
||||
|
@ -48,7 +48,7 @@ public class DoubleJumpListener implements Listener {
|
||||
if (player.getGameMode() != GameMode.ADVENTURE && player.getGameMode() != GameMode.SURVIVAL) {
|
||||
return;
|
||||
}
|
||||
if (LobbyPlayer.getLobbyPlayer(player).isFly()) {
|
||||
if (LobbyPlayer.getLobbyPlayer(player).hasFly()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ public class DoubleJumpListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if(player.getLocation().add(0, -1, 0).getBlock().getType() == Material.AIR) return;
|
||||
if (LobbyPlayer.getLobbyPlayer(player).isFly()) return;
|
||||
if (LobbyPlayer.getLobbyPlayer(player).hasFly()) return;
|
||||
|
||||
player.setAllowFlight(true);
|
||||
if (player.getGameMode() == GameMode.ADVENTURE || player.getGameMode() == GameMode.SURVIVAL) {
|
||||
|
@ -58,8 +58,6 @@ public class PlayerConnectionListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void handlePlayerKick(PlayerKickEvent event) {
|
||||
if (LobbyPlayer.getLobbyPlayer(event.getPlayer()).isFly())
|
||||
event.setCancelled(true);
|
||||
if(event.getReason().equals("Flying is not enabled on this server") && event.getPlayer().getVehicle() instanceof EnderPearl)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class LobbyPlayer {
|
||||
cache.put(uuid, this);
|
||||
}
|
||||
|
||||
public boolean isFly() {
|
||||
public boolean hasFly() {
|
||||
return fly;
|
||||
}
|
||||
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
isFly klingt so ein bisschen falsch, nenne es mal eher isFlying
vllt lieber hasFly() weil isFlying klingt auch nicht so gut?
if (LobbyPlayer.getLobbyPlayer(player).hasFly()) verwirrt auch erstmal. Deshalb isFlying.
hab ich