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