Paper/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch

121 lines
6.9 KiB
Diff
Raw Normal View History

From 68a9bbb09750538538bbcd3188803b142ba3f4e0 Mon Sep 17 00:00:00 2001
2015-01-29 22:25:50 +01:00
From: Zach Brown <zach.brown@destroystokyo.com>
2016-03-01 00:09:49 +01:00
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/EULA.java b/src/main/java/net/minecraft/server/EULA.java
index b64cac252..cc333de50 100644
--- a/src/main/java/net/minecraft/server/EULA.java
+++ b/src/main/java/net/minecraft/server/EULA.java
@@ -49,13 +49,12 @@ public class EULA {
Properties properties = new Properties();
fileoutputstream = new FileOutputStream(this.b);
properties.setProperty("eula", "false");
- properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).");
+ properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).\nYou also agree that tacos are tasty, and the best food in the world."); // Paper - fix lag);
} catch (Exception exception) {
a.warn("Failed to save {}", this.b, exception);
} finally {
IOUtils.closeQuietly(fileoutputstream);
}
-
}
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2d812b024..8a6589d95 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1213,7 +1213,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
public String getServerModName() {
- return "Spigot"; // Spigot - Spigot > // CraftBukkit - cb > vanilla!
2016-03-01 00:09:49 +01:00
+ return "Paper"; //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}
public CrashReport b(CrashReport crashreport) {
2016-03-01 00:09:49 +01:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b34a3564c..3a8e3ee81 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -159,7 +159,7 @@ import org.bukkit.event.server.TabCompleteEvent;
2017-12-28 05:45:33 +01:00
import net.md_5.bungee.api.chat.BaseComponent;
2016-03-01 00:09:49 +01:00
public final class CraftServer implements Server {
- private final String serverName = "CraftBukkit";
+ private final String serverName = "Paper"; // Paper
2016-03-01 00:09:49 +01:00
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 31c7404c3..1ce1a2435 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -200,13 +200,24 @@ public class Main {
2018-10-23 01:16:21 +02:00
deadline.add(Calendar.DAY_OF_YEAR, -7);
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/ ***");
+ System.err.println("*** Please download a new build as per instructions from https://paperci.emc.gs/ ***"); // Paper
2018-08-03 01:29:34 +02:00
System.err.println("*** Server will start in 20 seconds ***");
Thread.sleep(TimeUnit.SECONDS.toMillis(20));
}
}
- System.err.println("*** WARNING: This is a development build. It is not meant for production server usage! Please keep backups and update frequently.");
+ // 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...");
MinecraftServer.main(options);
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 94a3d4237..91b8aa6a1 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
private WatchdogThread(long timeoutTime, boolean restart)
{
- super( "Spigot Watchdog Thread" );
2016-03-01 00:09:49 +01:00
+ super( "Paper Watchdog Thread" );
this.timeoutTime = timeoutTime;
this.restart = restart;
}
@@ -56,9 +56,9 @@ public class WatchdogThread extends Thread
{
Logger log = Bukkit.getServer().getLogger();
log.log( Level.SEVERE, "The server has stopped responding!" );
- log.log( Level.SEVERE, "Please report this to http://www.spigotmc.org/" );
+ log.log( Level.SEVERE, "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() );
2016-03-01 00:09:49 +01:00
+ log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
//
if(net.minecraft.server.World.haveWeSilencedAPhysicsCrash)
{
@@ -68,7 +68,7 @@ public class WatchdogThread extends Thread
}
//
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" );
2016-03-01 00:09:49 +01:00
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" );
dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().primaryThread.getId(), Integer.MAX_VALUE ), log );
log.log( Level.SEVERE, "------------------------------" );
//
--
2018-10-23 01:16:21 +02:00
2.19.1