Fix DoubleJumpListener
Dieser Commit ist enthalten in:
Ursprung
cbf140cdfe
Commit
71a98bacaf
@ -1,6 +1,6 @@
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.steamwar.lobby.utils.LobbyPlayer;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -25,6 +25,9 @@ public class DoubleJumpListener implements Listener {
|
||||
@EventHandler
|
||||
public void handlePlayerToggleFlight(PlayerToggleFlightEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (player.getGameMode() != GameMode.ADVENTURE && player.getGameMode() != GameMode.SURVIVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
player.setAllowFlight(false);
|
||||
@ -47,7 +50,9 @@ public class DoubleJumpListener implements Listener {
|
||||
return;
|
||||
|
||||
player.setAllowFlight(true);
|
||||
player.setFlying(false);
|
||||
if (player.getGameMode() == GameMode.ADVENTURE || player.getGameMode() == GameMode.SURVIVAL) {
|
||||
player.setFlying(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren