From b57b24d549c65ddc5eb3edcc1ecc6aad2826dbd8 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 15 Jul 2024 12:46:23 -0700 Subject: [PATCH] Do not try to stop main thread during watchdog shutdown In Java 21, Thread#stop is no longer implemented and wiill throw an exception when called. As a result, we simply cannot halt the main thread during shutdown anymore. --- .../1026-Improved-Watchdog-Support.patch | 27 +++++++------------ .../server/1037-Lag-compensation-ticks.patch | 6 ++--- ...-Incremental-chunk-and-player-saving.patch | 4 +-- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/patches/server/1026-Improved-Watchdog-Support.patch b/patches/server/1026-Improved-Watchdog-Support.patch index f5f9b025c7..2e3fc383a2 100644 --- a/patches/server/1026-Improved-Watchdog-Support.patch +++ b/patches/server/1026-Improved-Watchdog-Support.patch @@ -71,7 +71,7 @@ index 589a8bf75be6ccc59f1e5dd5d8d9afed41c4772d..b24265573fdef5d9a964bcd76146f345 cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 17b0e570016504d1b7704bbfa9ff2e3233b45d09..330bee331335454a61cf8350a6654217c8124445 100644 +index 17b0e570016504d1b7704bbfa9ff2e3233b45d09..5d41801c2378ac27b67b977a8ab30158b717d4d3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -307,7 +307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1775,6 +1776,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers @@ -28,7 +28,7 @@ index 330bee331335454a61cf8350a6654217c8124445..54e581db732c3a104142a2bbc228ecbe this.profiler.push(() -> { String s = String.valueOf(worldserver); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2a08dfbda588bd6282d78b35bf33a0802b178a70..9c9107add605c09445cf795f4c850b080b4f995d 100644 +index a994456adb0034c0662151f4ae28c1c06f91333e..bee76ffe45e97c9c03430cf5a52d279421bc6536 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -509,6 +509,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. diff --git a/patches/server/1042-Incremental-chunk-and-player-saving.patch b/patches/server/1042-Incremental-chunk-and-player-saving.patch index cf8356f5b2..f6f0f055f9 100644 --- a/patches/server/1042-Incremental-chunk-and-player-saving.patch +++ b/patches/server/1042-Incremental-chunk-and-player-saving.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Incremental chunk and player saving diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 54e581db732c3a104142a2bbc228ecbe16aec0fc..c163745f878d484fdb2b8630e2167c7a03f45880 100644 +index c0935474538849b9274fab8fad13b8aa56b58f1f..aeae4f8d4ead24db315631c3d2c0b930d0d51e02 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -992,7 +992,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop