aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0339-Expose-MinecraftServer-isRunning.patch
blob: d60a818124b16dc46c71be919fbf7c7b8de444b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 d4231c9c22d3014702d856cb3b329ba3c4c6d0ce..070fba9322c5f8dd4f217685d8157d05cc78c95b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2866,5 +2866,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
 }