mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-22 06:55:36 +01:00
Use better variable for isStopping() API
Previous method only worked for a normal shutdown, and didn't include when the server enters a closing state due to watchdog crashes This is the correct variable to detect the server is in the middle of shutdown process
This commit is contained in:
parent
a5eb244a55
commit
372e545d08
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ 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.
|
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
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 53b71b7915..1a3c6aae18 100644
|
index 53b71b7915..8cc0f66ce5 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||||
|
@ -16,7 +16,7 @@ index 53b71b7915..1a3c6aae18 100644
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isStopping() {
|
+ public boolean isStopping() {
|
||||||
+ return !net.minecraft.server.MinecraftServer.getServer().isRunning();
|
+ return net.minecraft.server.MinecraftServer.getServer().hasStopped();
|
||||||
+ }
|
+ }
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue