mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-16 07:35:35 +01:00
23 lines
996 B
Diff
23 lines
996 B
Diff
|
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 4fa49b6bb26456d485f7f9193af560cb379e36f0..3f35e93b42efd03ff1002f09962fe3da51fb4c3f 100644
|
||
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||
|
@@ -2378,5 +2378,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
|
||
|
}
|