diff options
Diffstat (limited to 'patches/server/0368-Expose-MinecraftServer-isRunning.patch')
-rw-r--r-- | patches/server/0368-Expose-MinecraftServer-isRunning.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0368-Expose-MinecraftServer-isRunning.patch b/patches/server/0368-Expose-MinecraftServer-isRunning.patch new file mode 100644 index 0000000000..263db14d03 --- /dev/null +++ b/patches/server/0368-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 d0858a98a26745747ac50943a7ec1bb4c7491fb6..b92dff790cfe699c3e6a036f1377c3052373fe05 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -2678,5 +2678,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 + } |