From 760f623ace5e540e058485c783884b9ae754b387 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 10 Jul 2020 12:38:12 -0500 Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements --- .../net/minecraft/server/Main.java.patch | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 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 1b4fa089d9..0df11be5c3 100644 --- a/paper-server/patches/sources/net/minecraft/server/Main.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/Main.java.patch @@ -43,7 +43,7 @@ OptionParser optionparser = new OptionParser(); OptionSpec optionspec = optionparser.accepts("nogui"); OptionSpec optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits"); -@@ -90,50 +100,91 @@ +@@ -90,50 +100,92 @@ OptionSpec 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 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) {