Improves how lingering arena states are handled on shutdown

This commit is contained in:
2023-04-26 13:47:03 +02:00
parent 401490df58
commit 206a85b23a
9 changed files with 40 additions and 35 deletions

View File

@ -94,20 +94,17 @@ public abstract class AbstractPlayerEntryState implements PlayerEntryState {
}
@Override
public void restore() {
public boolean restore() {
Player player = getPlayer();
if (player == null) {
return;
return false;
}
restore(player);
return true;
}
/**
* Restores the state of the given player
*
* @param player <p>The player to restore the state for</p>
*/
public void restore(Player player) {
@Override
public void restore(@NotNull Player player) {
player.setFlying(this.originalIsFlying);
player.setGameMode(this.originalGameMode);
player.setAllowFlight(this.originalAllowFlight);