Start console thread after PaperConfig & MinecraftServer.console are initialized (#6716)

This commit is contained in:
Jason 2021-10-03 17:12:04 -05:00 committed by GitHub
parent e14aff9b32
commit a978f4122a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 5 deletions

View File

@ -206,6 +206,27 @@ index 0000000000000000000000000000000000000000..f33e9376bd166ebdb3d9f8c7467cd923
+ return builder.toAttributedString();
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 67afb97e6cb545d319202f3eca771015065089f6..0300390025c3f5461ef5f379c1710a58de164117 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -184,7 +184,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
- thread.start();
+ // thread.start(); // Paper - moved down
DedicatedServer.LOGGER.info("Starting minecraft server version {}", SharedConstants.getCurrentVersion().getName());
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
@@ -218,6 +218,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.error("Unable to load server configuration", e);
return false;
}
+ thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
com.destroystokyo.paper.PaperConfig.registerCommands();
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // load mappings for stacktrace deobf and etc.
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
index 14cd8ae69d9b25dc5edad4ff96ff4a9acb1f22cb..b3484487fa8baa4d1dd6c595586fb26a01a2153d 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java

View File

@ -42,10 +42,10 @@ index 0000000000000000000000000000000000000000..dd6012b6a097575b2d1471be5069ecce
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 67afb97e6cb545d319202f3eca771015065089f6..472d0635719c0a8f495ce474bd4a268d4e9071c8 100644
index 0300390025c3f5461ef5f379c1710a58de164117..2d53dba26af9d372a507ca2d46dec0cb5b9e41b1 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -221,6 +221,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -222,6 +222,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
com.destroystokyo.paper.PaperConfig.registerCommands();
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // load mappings for stacktrace deobf and etc.

View File

@ -27,10 +27,10 @@ index bdd4f4db9849d9107b5c62d5e83b1277621f49f1..9d09ec3b127e3440bef6b248578dec10
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 472d0635719c0a8f495ce474bd4a268d4e9071c8..1bf19965d12514dee34545235bfbadc0b74ddc8b 100644
index 2d53dba26af9d372a507ca2d46dec0cb5b9e41b1..7ce1ce59eeba8b57cd76b1c9c561733b476e7ebf 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -232,6 +232,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -233,6 +233,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist);
// this.worldData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
@ -51,7 +51,7 @@ index 472d0635719c0a8f495ce474bd4a268d4e9071c8..1bf19965d12514dee34545235bfbadc0
InetAddress inetaddress = null;
if (!this.getLocalIp().isEmpty()) {
@@ -241,12 +255,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -242,12 +256,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (this.getPort() < 0) {
this.setPort(dedicatedserverproperties.serverPort);
}