diff --git a/patches/unapplied/server/1010-Improved-Watchdog-Support.patch b/patches/server/1023-Improved-Watchdog-Support.patch similarity index 68% rename from patches/unapplied/server/1010-Improved-Watchdog-Support.patch rename to patches/server/1023-Improved-Watchdog-Support.patch index 88ad35da42..f7505594a4 100644 --- a/patches/unapplied/server/1010-Improved-Watchdog-Support.patch +++ b/patches/server/1023-Improved-Watchdog-Support.patch @@ -59,10 +59,10 @@ index 6aaed8e8bf8c721fc834da5c76ac72a4c3e92458..4b002e8b75d117b726b0de274a76d359 // Many servers tend to restart at a fixed time at xx:00 which causes an uneven distribution of requests on the // bStats backend. To circumvent this problem, we introduce some randomness into the initial and second delay. diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index bcb6a3b3cd17ce5db9aaf6bd3ec7a0ec1b44b979..4f3cc14d48690bb183d09bb7a5ba1e23e8a0c08a 100644 +index 589a8bf75be6ccc59f1e5dd5d8d9afed41c4772d..b24265573fdef5d9a964bcd76146f34542c420cf 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java -@@ -234,6 +234,7 @@ public class CrashReport { +@@ -237,6 +237,7 @@ public class CrashReport { } public static CrashReport forThrowable(Throwable cause, String title) { @@ -71,19 +71,19 @@ index bcb6a3b3cd17ce5db9aaf6bd3ec7a0ec1b44b979..4f3cc14d48690bb183d09bb7a5ba1e23 cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 02fbf3c44a46f4871deeb42a2678697d23235b2e..03552ca486807d057147f6a05f024989d593d046 100644 +index 7e32eecacf6f5e832dbfd0455e4bab1302a33d46..eb0a740f884fde081cabaec5a61c9b642a85a1b4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -300,7 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; - public Commands vanillaCommandDispatcher; + // Paper - don't store the vanilla dispatcher - private boolean forceTicks; -+ public boolean forceTicks; // Paper ++ public boolean forceTicks; // Paper - Improved watchdog support // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -313,6 +313,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system -@@ -930,6 +933,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop asList(String... params) { - return Arrays.asList(params); diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java index c6e8441e299f477ddb22c1ce2618710763978f1a..e8e93538dfd71de86515d9405f728db1631e949a 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java @@ -455,31 +344,31 @@ index c6e8441e299f477ddb22c1ce2618710763978f1a..e8e93538dfd71de86515d9405f728db1 } } diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java -index e3b262add194a126e731c68e68f3139a00cacacb..da7d5efd76c9ef92e9ce22860fec791890a687be 100644 +index f3fa0340babfc5eb627066115164e2d885c602c2..9ce945dce3ac8aa1d4eb55c41115f989b985d46d 100644 --- a/src/main/java/org/spigotmc/RestartCommand.java +++ b/src/main/java/org/spigotmc/RestartCommand.java -@@ -138,7 +138,7 @@ public class RestartCommand extends Command +@@ -139,7 +139,7 @@ public class RestartCommand extends Command // Paper end // Paper start - copied from above and modified to return if the hook registered - private static boolean addShutdownHook(String restartScript) -+ public static boolean addShutdownHook(String restartScript) ++ public static boolean addShutdownHook(String restartScript) // Paper { String[] split = restartScript.split( " " ); if ( split.length > 0 && new File( split[0] ).isFile() ) diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 9e5d08f57aa448552d100ca892c211d44441ef68..577f29519156f33b49ee319a64a52249630e28d8 100644 +index c68256c0c8e131497108f677c6b254c589ce67e2..b0a3ec17a50f4c302d6a9dd75bf907b01c567209 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -11,6 +11,7 @@ import org.bukkit.Bukkit; - public final class WatchdogThread extends io.papermc.paper.util.TickThread // Paper - rewrite chunk system + public class WatchdogThread extends Thread { -+ public static final boolean DISABLE_WATCHDOG = Boolean.getBoolean("disable.watchdog"); // Paper ++ public static final boolean DISABLE_WATCHDOG = Boolean.getBoolean("disable.watchdog"); // Paper - Improved watchdog support private static WatchdogThread instance; private long timeoutTime; private boolean restart; -@@ -39,6 +40,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -39,6 +40,7 @@ public class WatchdogThread extends Thread { if ( WatchdogThread.instance == null ) { @@ -487,7 +376,7 @@ index 9e5d08f57aa448552d100ca892c211d44441ef68..577f29519156f33b49ee319a64a52249 WatchdogThread.instance = new WatchdogThread( timeoutTime * 1000L, restart ); WatchdogThread.instance.start(); } else -@@ -70,12 +72,13 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -70,12 +72,13 @@ public class WatchdogThread extends Thread // Paper start Logger log = Bukkit.getServer().getLogger(); long currentTime = WatchdogThread.monotonicMillis(); @@ -504,7 +393,7 @@ index 9e5d08f57aa448552d100ca892c211d44441ef68..577f29519156f33b49ee319a64a52249 lastEarlyWarning = currentTime; if (isLongTimeout) { // Paper end -@@ -136,9 +139,24 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -136,9 +139,24 @@ public class WatchdogThread extends Thread if ( isLongTimeout ) {