diff options
Diffstat (limited to 'patches/server/0329-Expose-MinecraftServer-isRunning.patch')
-rw-r--r-- | patches/server/0329-Expose-MinecraftServer-isRunning.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0329-Expose-MinecraftServer-isRunning.patch b/patches/server/0329-Expose-MinecraftServer-isRunning.patch new file mode 100644 index 0000000000..03228c7907 --- /dev/null +++ b/patches/server/0329-Expose-MinecraftServer-isRunning.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JRoy <[email protected]> +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 edf6921ed70ea3281cf870dfb779e908ea3d1905..cb6f6762b41ca78ff7c13a65690ce0be1bdac292 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -2925,5 +2925,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 + } |