From e12c51d9bc867fc3538948c9b94075da6f6d92c5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 11 Apr 2020 21:26:16 -0400
Subject: [PATCH] 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
---
 .../0464-Expose-MinecraftServer-isRunning.patch             | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Spigot-Server-Patches/0464-Expose-MinecraftServer-isRunning.patch b/Spigot-Server-Patches/0464-Expose-MinecraftServer-isRunning.patch
index 278ed4a5e..545f20e88 100644
--- a/Spigot-Server-Patches/0464-Expose-MinecraftServer-isRunning.patch
+++ b/Spigot-Server-Patches/0464-Expose-MinecraftServer-isRunning.patch
@@ -1,4 +1,4 @@
-From 54f024d408679baaaaad219aeb853145ca144554 Mon Sep 17 00:00:00 2001
+From 74bded28475f71d83b3c303911693a17b678b4c8 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
@@ -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.
 
 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
 +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
 @@ -2217,5 +2217,10 @@ public final class CraftServer implements Server {
@@ -16,7 +16,7 @@ index 53b71b7915..1a3c6aae18 100644
 +
 +    @Override
 +    public boolean isStopping() {
-+        return !net.minecraft.server.MinecraftServer.getServer().isRunning();
++        return net.minecraft.server.MinecraftServer.getServer().hasStopped();
 +    }
      // Paper end
  }