Fix SPIGOT-5885 Unable to disable advancements

This commit is contained in:
William Blake Galbreath 2020-07-10 12:38:12 -05:00
parent 1110af5fe2
commit 760f623ace

View file

@ -43,7 +43,7 @@
OptionParser optionparser = new OptionParser();
OptionSpec<Void> optionspec = optionparser.accepts("nogui");
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
@@ -90,50 +100,91 @@
@@ -90,50 +100,92 @@
OptionSpec<String> optionspec15 = optionparser.nonOptions();
try {
@ -125,6 +125,7 @@
- File file = new File((String) optionset.valueOf(optionspec9));
- Services services = Services.create(new YggdrasilAuthenticationService(Proxy.NO_PROXY), file);
- String s = (String) Optional.ofNullable((String) optionset.valueOf(optionspec10)).orElse(dedicatedserversettings.getProperties().levelName);
+ org.spigotmc.SpigotConfig.disabledAdvancements = spigotConfiguration.getStringList("advancements.disabled"); // Paper - fix SPIGOT-5885, must be set early in init
+ // Paper start - fix SPIGOT-5824
+ File file;
+ File userCacheFile = new File(Services.USERID_CACHE_FILE);
@ -145,7 +146,7 @@
Dynamic dynamic;
if (convertable_conversionsession.hasWorldData()) {
@@ -174,13 +225,31 @@
@@ -174,13 +226,31 @@
}
Dynamic<?> dynamic1 = dynamic;
@ -178,7 +179,7 @@
WorldStem worldstem;
@@ -189,6 +258,7 @@
@@ -189,6 +259,7 @@
worldstem = (WorldStem) Util.blockUntilDone((executor) -> {
return WorldLoader.load(worldloader_c, (worldloader_a) -> {
@ -186,7 +187,7 @@
Registry<LevelStem> iregistry = worldloader_a.datapackDimensions().lookupOrThrow(Registries.LEVEL_STEM);
if (dynamic1 != null) {
@@ -201,7 +271,7 @@
@@ -201,7 +272,7 @@
WorldOptions worldoptions;
WorldDimensions worlddimensions;
@ -195,7 +196,7 @@
worldsettings = MinecraftServer.DEMO_SETTINGS;
worldoptions = WorldOptions.DEMO_OPTIONS;
worlddimensions = WorldPresets.createNormalWorldDimensions(worldloader_a.datapackWorldgen());
@@ -209,7 +279,7 @@
@@ -209,7 +280,7 @@
DedicatedServerProperties dedicatedserverproperties = dedicatedserversettings.getProperties();
worldsettings = new LevelSettings(dedicatedserverproperties.levelName, dedicatedserverproperties.gamemode, dedicatedserverproperties.hardcore, dedicatedserverproperties.difficulty, false, new GameRules(worldloader_a.dataConfiguration().enabledFeatures()), worldloader_a.dataConfiguration());
@ -204,7 +205,7 @@
worlddimensions = dedicatedserverproperties.createDimensions(worldloader_a.datapackWorldgen());
}
@@ -225,32 +295,44 @@
@@ -225,32 +296,44 @@
return;
}
@ -254,7 +255,7 @@
Thread thread = new Thread("Server Shutdown Thread") {
public void run() {
dedicatedserver.halt(true);
@@ -259,6 +341,7 @@
@@ -259,6 +342,7 @@
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER));
Runtime.getRuntime().addShutdownHook(thread);
@ -262,7 +263,7 @@
} catch (Exception exception1) {
Main.LOGGER.error(LogUtils.FATAL_MARKER, "Failed to start the minecraft server", exception1);
}
@@ -295,7 +378,7 @@
@@ -295,7 +379,7 @@
}
public static void forceUpgrade(LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, boolean eraseCache, BooleanSupplier continueCheck, RegistryAccess dynamicRegistryManager, boolean recreateRegionFiles) {