Makes sure levers are reset on an immediate quit

This commit is contained in:
Kristian Knarvik 2024-04-30 16:32:15 +02:00
parent fb68c18fe6
commit eceb7fc6d2

View File

@ -184,7 +184,8 @@ public class ParkourArenaSession extends AbstractArenaSession {
public void triggerQuit(boolean immediately, boolean removeSession) {
super.triggerQuit(immediately, removeSession);
if (MiniGames.getInstance().getParkourArenaPlayerRegistry().getPlayingPlayers(this.arena).isEmpty()) {
// Note: As immediately is only used when stopping the server, levers should be reset regardless of current players
if (MiniGames.getInstance().getParkourArenaPlayerRegistry().getPlayingPlayers(this.arena).isEmpty() || immediately) {
resetLevers();
}
}