2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								From: Zach Brown <1254957+zachbr@users.noreply.github.com>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Date: Tue, 1 Mar 2016 14:32:43 -0600
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 stats
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								--- a/src/main/java/net/minecraft/server/MinecraftServer.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:37:16 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								     @DontObfuscate
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								     public String getServerModName() {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-        return "Spigot"; // Spigot - Spigot > // CraftBukkit - cb > vanilla!
 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-11 13:22:51 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								+        return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								     }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-07 08:52:40 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								     public SystemReport fillSystemReport(SystemReport details) {
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								@@ -0,0 +0,0 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 import net.md_5.bungee.api.chat.BaseComponent; // Spigot
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 public final class CraftServer implements Server {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-    private final String serverName = "CraftBukkit";
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+    private final String serverName = "Paper"; // Paper
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     private final String serverVersion;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     private final String bukkitVersion = Versioning.getBukkitVersion();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     private final Logger logger = Logger.getLogger("Minecraft");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								--- a/src/main/java/org/bukkit/craftbukkit/Main.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								@@ -0,0 +0,0 @@ public class Main {
 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-26 09:53:35 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                     deadline.add(Calendar.DAY_OF_YEAR, -14);
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								                     if (buildDate.before(deadline.getTime())) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                         System.err.println("*** Error, this build is outdated ***");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-                        System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                        System.err.println("*** Please download a new build as per instructions from https://papermc.io/downloads ***"); // Paper
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                         System.err.println("*** Server will start in 20 seconds ***");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                         Thread.sleep(TimeUnit.SECONDS.toMillis(20));
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                     }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                // Paper start - Log Java and OS versioning to help with debugging plugin issues
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                java.lang.management.RuntimeMXBean runtimeMX = java.lang.management.ManagementFactory.getRuntimeMXBean();
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                java.lang.management.OperatingSystemMXBean osMX = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                if (runtimeMX != null && osMX != null) {
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                    String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")";
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                    String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")";
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                    System.out.println("System Info: " + javaInfo + " " + osInfo);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                } else {
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                    System.out.println("Unable to read system info");
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                }
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                // Paper end
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 System.out.println("Loading libraries, please wait...");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								--- a/src/main/java/org/spigotmc/WatchdogThread.java
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+++ b/src/main/java/org/spigotmc/WatchdogThread.java
 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-26 01:02:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     private WatchdogThread(long timeoutTime, boolean restart)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-        super( "Spigot Watchdog Thread" );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+        super( "Paper Watchdog Thread" );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								         this.timeoutTime = timeoutTime;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								         this.restart = restart;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     }
							 
						 
					
						
							
								
									
										
										
										
											2022-09-26 01:02:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								             {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 Logger log = Bukkit.getServer().getLogger();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 log.log( Level.SEVERE, "------------------------------" );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-                log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Spigot bug." );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                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" );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-                log.log( Level.SEVERE, "If you are unsure or still think this is a Spigot bug, please report to https://www.spigotmc.org/" );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                log.log( Level.SEVERE, "If you are unsure or still think this is a Paper bug, please report this to https://github.com/PaperMC/Paper/issues" );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-                log.log( Level.SEVERE, "Spigot version: " + Bukkit.getServer().getVersion() );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 //
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 {
							 
						 
					
						
							
								
									
										
										
										
											2022-09-26 01:02:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								                 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 //
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 log.log( Level.SEVERE, "------------------------------" );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-                log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+                log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-26 01:02:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                 io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:37:16 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                 WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 14:02:28 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								                 log.log( Level.SEVERE, "------------------------------" );