mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 22:47:49 +01:00
Prevent the server from stopping twice
This commit is contained in:
parent
01e39b5d98
commit
91983e16eb
@ -118,7 +118,7 @@ public final class MinecraftServer {
|
|||||||
// Data
|
// Data
|
||||||
private static boolean initialized;
|
private static boolean initialized;
|
||||||
private static boolean started;
|
private static boolean started;
|
||||||
private static boolean stopping;
|
private static volatile boolean stopping;
|
||||||
|
|
||||||
private static int chunkViewDistance = 8;
|
private static int chunkViewDistance = 8;
|
||||||
private static int entityViewDistance = 5;
|
private static int entityViewDistance = 5;
|
||||||
@ -709,6 +709,7 @@ public final class MinecraftServer {
|
|||||||
* Stops this server properly (saves if needed, kicking players, etc.)
|
* Stops this server properly (saves if needed, kicking players, etc.)
|
||||||
*/
|
*/
|
||||||
public static void stopCleanly() {
|
public static void stopCleanly() {
|
||||||
|
if (stopping) return;
|
||||||
stopping = true;
|
stopping = true;
|
||||||
LOGGER.info("Stopping Minestom server.");
|
LOGGER.info("Stopping Minestom server.");
|
||||||
extensionManager.unloadAllExtensions();
|
extensionManager.unloadAllExtensions();
|
||||||
|
Loading…
Reference in New Issue
Block a user