diff --git a/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index fdb6504aa..142956669 100644 --- a/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -32,7 +32,7 @@ index 3a11fca68223def767d8b140d177f2874299422a..42942635c69752fe2f5091759f07ed4a public CrashReport b(CrashReport crashreport) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 90551257c299aaf694eb4f4063d5b1b3eee94876..ac177cd391e220af7584463e35f1f11e0393cde8 100644 +index 73bd46c980cb13d6cbe4aba41adb122eaab769be..59ebde67a89b26c537d77bf2004a61316be715a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -227,7 +227,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -76,7 +76,7 @@ index 3a6578170765a472d36b169b999e9dc57bf8070b..a34b1ba17e6f7121ed70c3d95ec8f4aa net.minecraft.server.Main.main(options); } catch (Throwable t) { diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 54fa83c127bf2f8fe30295864f5f73cf6248ad28..73fa74e3cc0239a38cd2ba41b3e9e991a5c4ebf9 100644 +index d7adcdceecb48d8ae605ddd305dcc06ec05ed3dd..bf240231b70dbaf71f359318e5c0f8ba1490a067 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -19,7 +19,7 @@ public class WatchdogThread extends Thread @@ -88,7 +88,7 @@ index 54fa83c127bf2f8fe30295864f5f73cf6248ad28..73fa74e3cc0239a38cd2ba41b3e9e991 this.timeoutTime = timeoutTime; this.restart = restart; } -@@ -61,14 +61,14 @@ public class WatchdogThread extends Thread +@@ -65,14 +65,14 @@ public class WatchdogThread extends Thread { Logger log = Bukkit.getServer().getLogger(); log.log( Level.SEVERE, "------------------------------" ); @@ -106,7 +106,7 @@ index 54fa83c127bf2f8fe30295864f5f73cf6248ad28..73fa74e3cc0239a38cd2ba41b3e9e991 // if ( net.minecraft.server.World.lastPhysicsProblem != null ) { -@@ -78,7 +78,7 @@ public class WatchdogThread extends Thread +@@ -82,7 +82,7 @@ public class WatchdogThread extends Thread } // log.log( Level.SEVERE, "------------------------------" ); diff --git a/Spigot-Server-Patches/0052-Add-velocity-warnings.patch b/Spigot-Server-Patches/0052-Add-velocity-warnings.patch index 722af167e..25ec61089 100644 --- a/Spigot-Server-Patches/0052-Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/0052-Add-velocity-warnings.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b5e1ae8efb7165547e228d2c9d6d84a72b772df5..fb18d519961f5130e7b6907d24305b35622bb63c 100644 +index 6d410521707c88abbf1b9d2054bb16d3b1aa2394..cbf54bd024426e324c95b41b3eb6ebbadc4b8b13 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -263,6 +263,7 @@ public final class CraftServer implements Server { @@ -17,7 +17,7 @@ index b5e1ae8efb7165547e228d2c9d6d84a72b772df5..fb18d519961f5130e7b6907d24305b35 static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 2896dae1093e148f776905bf18ddb5b73deec326..0bce938a1db4ea11d4ed647530d6c44ec9dbe975 100644 +index b9a789b161d20aefd93142cb7549f3023d402e8c..baa54065500b98e3fabce053ad659b44d0a200ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -424,10 +424,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -63,10 +63,10 @@ index 2896dae1093e148f776905bf18ddb5b73deec326..0bce938a1db4ea11d4ed647530d6c44e public double getHeight() { return getHandle().getHeight(); diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 73fa74e3cc0239a38cd2ba41b3e9e991a5c4ebf9..d9610006113e5f67c2feeea332b2920230822d41 100644 +index bf240231b70dbaf71f359318e5c0f8ba1490a067..0cb3028872041ce9f75e57fdd84b79636d8809f3 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java -@@ -76,7 +76,19 @@ public class WatchdogThread extends Thread +@@ -80,7 +80,19 @@ public class WatchdogThread extends Thread log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" ); log.log( Level.SEVERE, "near " + net.minecraft.server.World.lastPhysicsProblem ); } diff --git a/Spigot-Server-Patches/0097-System-property-for-disabling-watchdoge.patch b/Spigot-Server-Patches/0097-System-property-for-disabling-watchdoge.patch index 0a646f4c8..e05a8f815 100644 --- a/Spigot-Server-Patches/0097-System-property-for-disabling-watchdoge.patch +++ b/Spigot-Server-Patches/0097-System-property-for-disabling-watchdoge.patch @@ -5,15 +5,15 @@ Subject: [PATCH] System property for disabling watchdoge diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index d9610006113e5f67c2feeea332b2920230822d41..121c7ff60195f9904b8afb3a305e97bbcb80a738 100644 +index 0cb3028872041ce9f75e57fdd84b79636d8809f3..882cd398ee6babc3088ea0bb442d61fb46d8bf08 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java -@@ -57,7 +57,7 @@ public class WatchdogThread extends Thread +@@ -61,7 +61,7 @@ public class WatchdogThread extends Thread while ( !stopping ) { // -- if ( lastTick != 0 && monotonicMillis() > lastTick + timeoutTime ) -+ if ( lastTick != 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable +- if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime ) ++ if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable { Logger log = Bukkit.getServer().getLogger(); log.log( Level.SEVERE, "------------------------------" ); diff --git a/Spigot-Server-Patches/0261-Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/0261-Add-Early-Warning-Feature-to-WatchDog.patch index f38344d59..bd84a8190 100644 --- a/Spigot-Server-Patches/0261-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/0261-Add-Early-Warning-Feature-to-WatchDog.patch @@ -81,7 +81,7 @@ index b830bfefd2984f012de0e3877592e5198a2a02ea..25a0873553a0ec6b2913e0cfb928f98e public static boolean bungee; diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 121c7ff60195f9904b8afb3a305e97bbcb80a738..07936eeba2a1aa68d52f4183f663ce362c816a54 100644 +index 882cd398ee6babc3088ea0bb442d61fb46d8bf08..1827fb786338fa49d15a3ab231eb7f26a8fa93b6 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -5,6 +5,7 @@ import java.lang.management.MonitorInfo; @@ -92,17 +92,17 @@ index 121c7ff60195f9904b8afb3a305e97bbcb80a738..07936eeba2a1aa68d52f4183f663ce36 import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; -@@ -13,6 +14,10 @@ public class WatchdogThread extends Thread - +@@ -14,6 +15,10 @@ public class WatchdogThread extends Thread private static WatchdogThread instance; - private final long timeoutTime; + private long timeoutTime; + private boolean restart; + private final long earlyWarningEvery; // Paper - Timeout time for just printing a dump but not restarting + private final long earlyWarningDelay; // Paper + public static volatile boolean hasStarted; // Paper + private long lastEarlyWarning; // Paper - Keep track of short dump times to avoid spamming console with short dumps - private final boolean restart; private volatile long lastTick; private volatile boolean stopping; + @@ -22,6 +27,8 @@ public class WatchdogThread extends Thread super( "Paper Watchdog Thread" ); this.timeoutTime = timeoutTime; @@ -112,16 +112,16 @@ index 121c7ff60195f9904b8afb3a305e97bbcb80a738..07936eeba2a1aa68d52f4183f663ce36 } private static long monotonicMillis() -@@ -56,10 +63,18 @@ public class WatchdogThread extends Thread +@@ -60,10 +67,18 @@ public class WatchdogThread extends Thread { while ( !stopping ) { - // -- if ( lastTick != 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable +- if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable + // Paper start + Logger log = Bukkit.getServer().getLogger(); + long currentTime = monotonicMillis(); -+ if ( lastTick != 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) ++ if ( lastTick != 0 && timeoutTime > 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) { - Logger log = Bukkit.getServer().getLogger(); + boolean isLongTimeout = currentTime > lastTick + timeoutTime; @@ -134,7 +134,7 @@ index 121c7ff60195f9904b8afb3a305e97bbcb80a738..07936eeba2a1aa68d52f4183f663ce36 log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Paper bug." ); // Paper log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" ); -@@ -89,29 +104,46 @@ public class WatchdogThread extends Thread +@@ -93,29 +108,46 @@ public class WatchdogThread extends Thread } } // Paper end diff --git a/Spigot-Server-Patches/0368-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0368-Asynchronous-chunk-IO-and-loading.patch index 7e91b3a01..47c61e6b9 100644 --- a/Spigot-Server-Patches/0368-Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/0368-Asynchronous-chunk-IO-and-loading.patch @@ -4127,7 +4127,7 @@ index e2d4aa9ba7fa007b3d93a166c5fb57c8a90387ed..666876943675a8c299b414f6b5ea359a public boolean teleport(Location location) { return teleport(location, TeleportCause.PLUGIN); diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 07936eeba2a1aa68d52f4183f663ce362c816a54..5bdcdcf9e85b73086722783bff26321d03382bb9 100644 +index 1827fb786338fa49d15a3ab231eb7f26a8fa93b6..9c1fc19851817a842779ab89bc9300e1adf3d2a2 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -6,6 +6,7 @@ import java.lang.management.ThreadInfo; @@ -4138,7 +4138,7 @@ index 07936eeba2a1aa68d52f4183f663ce362c816a54..5bdcdcf9e85b73086722783bff26321d import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; -@@ -112,6 +113,7 @@ public class WatchdogThread extends Thread +@@ -116,6 +117,7 @@ public class WatchdogThread extends Thread // Paper end - Different message for short timeout log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper diff --git a/Spigot-Server-Patches/0437-Improved-Watchdog-Support.patch b/Spigot-Server-Patches/0437-Improved-Watchdog-Support.patch index 0bdc438c3..0220ea3dd 100644 --- a/Spigot-Server-Patches/0437-Improved-Watchdog-Support.patch +++ b/Spigot-Server-Patches/0437-Improved-Watchdog-Support.patch @@ -495,7 +495,7 @@ index aefea3a9a8b9b75c62bd20018be7cd166a213001..123de5ac9026508e21cdc225f0962f5c 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 5bdcdcf9e85b73086722783bff26321d03382bb9..513c1041c34ebb3ac1775674a3f4526693759c08 100644 +index 9c1fc19851817a842779ab89bc9300e1adf3d2a2..ae8903ee1decd22e2ad6138f29fbc757b807e0a7 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -13,6 +13,7 @@ import org.bukkit.Bukkit; @@ -504,8 +504,8 @@ index 5bdcdcf9e85b73086722783bff26321d03382bb9..513c1041c34ebb3ac1775674a3f45266 + public static final boolean DISABLE_WATCHDOG = Boolean.getBoolean("disable.watchdog"); // Paper private static WatchdogThread instance; - private final long timeoutTime; - private final long earlyWarningEvery; // Paper - Timeout time for just printing a dump but not restarting + private long timeoutTime; + private boolean restart; @@ -41,6 +42,7 @@ public class WatchdogThread extends Thread { if ( instance == null ) @@ -513,14 +513,14 @@ index 5bdcdcf9e85b73086722783bff26321d03382bb9..513c1041c34ebb3ac1775674a3f45266 + if (timeoutTime <= 0) timeoutTime = 300; // Paper instance = new WatchdogThread( timeoutTime * 1000L, restart ); instance.start(); - } -@@ -67,12 +69,13 @@ public class WatchdogThread extends Thread + } else +@@ -71,12 +73,13 @@ public class WatchdogThread extends Thread // Paper start Logger log = Bukkit.getServer().getLogger(); long currentTime = monotonicMillis(); -- if ( lastTick != 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) +- if ( lastTick != 0 && timeoutTime > 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) + MinecraftServer server = MinecraftServer.getServer(); -+ if (lastTick != 0 && hasStarted && (!server.isRunning() || (currentTime > lastTick + earlyWarningEvery && !DISABLE_WATCHDOG) )) ++ if (lastTick != 0 && timeoutTime > 0 && hasStarted && (!server.isRunning() || (currentTime > lastTick + earlyWarningEvery && !DISABLE_WATCHDOG) )) { - boolean isLongTimeout = currentTime > lastTick + timeoutTime; + boolean isLongTimeout = currentTime > lastTick + timeoutTime || (!server.isRunning() && !server.hasStopped() && currentTime > lastTick + 1000); @@ -531,7 +531,7 @@ index 5bdcdcf9e85b73086722783bff26321d03382bb9..513c1041c34ebb3ac1775674a3f45266 lastEarlyWarning = currentTime; if (isLongTimeout) { // Paper end -@@ -114,7 +117,7 @@ public class WatchdogThread extends Thread +@@ -118,7 +121,7 @@ public class WatchdogThread extends Thread log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper ChunkTaskManager.dumpAllChunkLoadInfo(); // Paper @@ -540,7 +540,7 @@ index 5bdcdcf9e85b73086722783bff26321d03382bb9..513c1041c34ebb3ac1775674a3f45266 log.log( Level.SEVERE, "------------------------------" ); // // Paper start - Only print full dump on long timeouts -@@ -135,9 +138,24 @@ public class WatchdogThread extends Thread +@@ -139,9 +142,24 @@ public class WatchdogThread extends Thread if ( isLongTimeout ) { diff --git a/work/Bukkit b/work/Bukkit index 64c36cce2..bf6176594 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 64c36cce230d53551d364159757d108118b87dbe +Subproject commit bf6176594c2809778e59fafb3eb1aabcbde4093f diff --git a/work/Spigot b/work/Spigot index a56d446a8..5fc0fb4e4 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit a56d446a8d1972666d063ceb70e5c18f72347a9c +Subproject commit 5fc0fb4e4cf682f5992f1e5f64ae9be5c0a3baf1