From c57aa25ca248a94a058ec6b5783535e7bc5434e5 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 3 Oct 2021 17:12:04 -0500 Subject: [PATCH] Start console thread after PaperConfig & MinecraftServer.console are initialized (#6716) --- ...tab-completions-for-brigadier-comman.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch index 4376fdf3c8..fba6cf5da0 100644 --- a/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch +++ b/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch @@ -206,6 +206,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +@@ -0,0 +0,0 @@ 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\""); +@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java