From e47b9688a8e5a0f287839742f0787b336cacf930 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 22 Jun 2021 08:05:43 +0200 Subject: [PATCH] Fix ConnectionListener for player leave --- src/de/steamwar/misslewars/listener/ConnectionListener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/de/steamwar/misslewars/listener/ConnectionListener.java b/src/de/steamwar/misslewars/listener/ConnectionListener.java index 41139d9..245598f 100644 --- a/src/de/steamwar/misslewars/listener/ConnectionListener.java +++ b/src/de/steamwar/misslewars/listener/ConnectionListener.java @@ -22,6 +22,7 @@ package de.steamwar.misslewars.listener; import de.steamwar.misslewars.FightState; import de.steamwar.misslewars.MWTeam; import de.steamwar.misslewars.MissileWars; +import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -47,6 +48,10 @@ public class ConnectionListener extends BasicListener{ public void onLeave(PlayerQuitEvent e) { MWTeam.removeInvitations(e.getPlayer()); MissileWars.leave(e.getPlayer()); + + if (Bukkit.getOnlinePlayers().isEmpty()) { + Bukkit.shutdown(); + } } }