diff options
Diffstat (limited to 'patches/unapplied/server/0359-Expose-MinecraftServer-isRunning.patch')
-rw-r--r-- | patches/unapplied/server/0359-Expose-MinecraftServer-isRunning.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/unapplied/server/0359-Expose-MinecraftServer-isRunning.patch b/patches/unapplied/server/0359-Expose-MinecraftServer-isRunning.patch new file mode 100644 index 0000000000..8351ea66ee --- /dev/null +++ b/patches/unapplied/server/0359-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 4545083ceb2e180881b981842ef8857dbe4773dd..83661761abdb31e62ea56af9d60fed393326be50 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -2832,5 +2832,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 + } |