Paper/Spigot-Server-Patches/0432-Expose-MinecraftServer-isRunning.patch
Aikar 9c9583cd2b
[Auto] Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
8f495b8d #564: Add method to get max world size

CraftBukkit Changes:
768d7fc2d #773: Add method to get max world size

Spigot Changes:
628435a8 #103: Add async catchers to Chunk#getEntities
2020-12-12 19:42:05 -05:00

23 lines
996 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: JRoy <joshroy126@gmail.com>
Date: Fri, 10 Apr 2020 21:24:12 -0400
Subject: [PATCH] Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8238343fe4d434d88874bb06e2fbcfc0d289685a..f546f7ac0484b6224b878ad39285ffccd7410b96 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2314,5 +2314,10 @@ public final class CraftServer implements Server {
public int getCurrentTick() {
return net.minecraft.server.MinecraftServer.currentTick;
}
+
+ @Override
+ public boolean isStopping() {
+ return net.minecraft.server.MinecraftServer.getServer().hasStopped();
+ }
// Paper end
}