Hopefully prevents an exception when restoring a player's fly state

This commit is contained in:
Kristian Knarvik 2023-05-12 13:16:32 +02:00
parent 9c91e11780
commit de5124c8dd

View File

@ -88,9 +88,9 @@ public abstract class AbstractPlayerEntryState implements PlayerEntryState {
@Override @Override
public void restore(@NotNull Player player) { public void restore(@NotNull Player player) {
player.setFlying(this.originalIsFlying);
player.setGameMode(this.originalGameMode);
player.setAllowFlight(this.originalAllowFlight); player.setAllowFlight(this.originalAllowFlight);
player.setFlying(player.getAllowFlight() && this.originalIsFlying);
player.setGameMode(this.originalGameMode);
player.setInvulnerable(this.originalInvulnerable); player.setInvulnerable(this.originalInvulnerable);
player.setSwimming(this.originalIsSwimming); player.setSwimming(this.originalIsSwimming);
removeMenuItem(player); removeMenuItem(player);