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;
|
||||
}
|
||||
|
||||
Lixfel
hat
isFly klingt so ein bisschen falsch, nenne es mal eher isFlying isFly klingt so ein bisschen falsch, nenne es mal eher isFlying
YoyoNow
hat
vllt lieber hasFly() weil isFlying klingt auch nicht so gut? vllt lieber hasFly() weil isFlying klingt auch nicht so gut?
Lixfel
hat
if (LobbyPlayer.getLobbyPlayer(player).hasFly()) verwirrt auch erstmal. Deshalb isFlying. if (LobbyPlayer.getLobbyPlayer(player).hasFly()) verwirrt auch erstmal. Deshalb isFlying.
YoyoNow
hat
hab ich hab ich
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Das dürfte unnötig sein, schließlich kümmert sich schon Flying is not enabled drum. Zudem wenn man von Serverseite aus Fliegen kann, gibt es keinen Kickgrund für den Server.