Fix demo flag not enabling demo mode

https://github.com/PaperMC/Paper/issues/9046
This commit is contained in:
Warrior 2023-04-07 20:11:17 +02:00
parent 988f9ed56f
commit 915f048f00

View file

@ -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) {