Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
4e958e229f
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: zml <zml@stellardrift.ca> Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
23 Zeilen
996 B
Diff
23 Zeilen
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 7756b25f4b7e5aae7eb6f3e8b347db4d531589f4..fa96805c33ab16fe3a8ffbc5e5b1a4517269dd41 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2372,5 +2372,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
|
|
}
|