From 915f048f009ee6938161ab10a82cce367dc3fb6a Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Fri, 7 Apr 2023 20:11:17 +0200 Subject: [PATCH] Fix demo flag not enabling demo mode https://github.com/PaperMC/Paper/issues/9046 --- .../sources/net/minecraft/server/Main.java.patch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/server/Main.java.patch b/paper-server/patches/sources/net/minecraft/server/Main.java.patch index 182db91996..a9ae49e37f 100644 --- a/paper-server/patches/sources/net/minecraft/server/Main.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/Main.java.patch @@ -217,7 +217,7 @@ worlddimensions = dedicatedserverproperties.createDimensions(worldloader_a.datapackWorldgen()); } -@@ -225,32 +308,45 @@ +@@ -225,32 +308,47 @@ return; } @@ -244,7 +244,10 @@ + /* dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec11)); - dedicatedserver1.setDemo(optionset.has(optionspec2)); +- dedicatedserver1.setDemo(optionset.has(optionspec2)); ++ */ ++ dedicatedserver1.setDemo(optionset.has("demo")); // Paper ++ /* dedicatedserver1.setId((String) optionset.valueOf(optionspec12)); - boolean flag2 = !optionset.has(optionspec) && !optionset.valuesOf(optionspec15).contains("nogui"); + */ @@ -268,7 +271,7 @@ Thread thread = new Thread("Server Shutdown Thread") { public void run() { dedicatedserver.halt(true); -@@ -259,6 +355,7 @@ +@@ -259,6 +357,7 @@ thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER)); Runtime.getRuntime().addShutdownHook(thread); @@ -276,7 +279,7 @@ } catch (Exception exception1) { Main.LOGGER.error(LogUtils.FATAL_MARKER, "Failed to start the minecraft server", exception1); } -@@ -295,7 +392,7 @@ +@@ -295,7 +394,7 @@ } public static void forceUpgrade(LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, boolean eraseCache, BooleanSupplier continueCheck, RegistryAccess dynamicRegistryManager, boolean recreateRegionFiles) {