From de5124c8dd76a4e24eebe04d227cb77bf2c77cc0 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 12 May 2023 13:16:32 +0200 Subject: [PATCH] Hopefully prevents an exception when restoring a player's fly state --- .../knarcraft/minigames/arena/AbstractPlayerEntryState.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/minigames/arena/AbstractPlayerEntryState.java b/src/main/java/net/knarcraft/minigames/arena/AbstractPlayerEntryState.java index 27e6ec9..bfbce94 100644 --- a/src/main/java/net/knarcraft/minigames/arena/AbstractPlayerEntryState.java +++ b/src/main/java/net/knarcraft/minigames/arena/AbstractPlayerEntryState.java @@ -88,9 +88,9 @@ public abstract class AbstractPlayerEntryState implements PlayerEntryState { @Override public void restore(@NotNull Player player) { - player.setFlying(this.originalIsFlying); - player.setGameMode(this.originalGameMode); player.setAllowFlight(this.originalAllowFlight); + player.setFlying(player.getAllowFlight() && this.originalIsFlying); + player.setGameMode(this.originalGameMode); player.setInvulnerable(this.originalInvulnerable); player.setSwimming(this.originalIsSwimming); removeMenuItem(player);