diff --git a/patches/api/0429-Initialisation-improvements.patch b/patches/api/0418-Initialisation-improvements.patch similarity index 85% rename from patches/api/0429-Initialisation-improvements.patch rename to patches/api/0418-Initialisation-improvements.patch index 6c3cb3bb8d..d07664d188 100644 --- a/patches/api/0429-Initialisation-improvements.patch +++ b/patches/api/0418-Initialisation-improvements.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Initialisation improvements diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index f7cfe6c0d9d52ed72d0d45baaaf856c15769c668..5ca6976c86d680ec6e2fc8bc3bcb54af56ac8138 100644 +index 7d300a539ac2ef1c773cfa90cecc8655490a8686..f5fdc6b0f8917db82fcac7dd6efe8314c87eb25e 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -180,47 +180,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -189,47 +189,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm Class result = classes.get(name); if (result == null) { @@ -24,7 +24,7 @@ index f7cfe6c0d9d52ed72d0d45baaaf856c15769c668..5ca6976c86d680ec6e2fc8bc3bcb54af - throw new ClassNotFoundException(name, ex); - } - -- classBytes = loader.server.getUnsafe().processClass(description, path, classBytes); +- classBytes = org.bukkit.Bukkit.getServer().getUnsafe().processClass(description, path, classBytes); // Paper - - int dot = name.lastIndexOf('.'); - if (dot != -1) { @@ -55,5 +55,5 @@ index f7cfe6c0d9d52ed72d0d45baaaf856c15769c668..5ca6976c86d680ec6e2fc8bc3bcb54af - } + result = super.findClass(name); - loader.setClass(name, result); classes.put(name, result); + this.setClass(name, result); // Paper diff --git a/patches/server/0962-Initialisation-improvements.patch b/patches/server/0962-Initialisation-improvements.patch index 1cb2d99f57..c11d900d2b 100644 --- a/patches/server/0962-Initialisation-improvements.patch +++ b/patches/server/0962-Initialisation-improvements.patch @@ -58,10 +58,10 @@ index b8b17d046f836c8652ab094db00ab1af84971b2c..e5790e871c46f9d2b92237ed378ecea5 this.mappingsByObfName = maps.stream().collect(Collectors.toUnmodifiableMap(ClassMapping::obfName, map -> map)); this.mappingsByMojangName = maps.stream().collect(Collectors.toUnmodifiableMap(ClassMapping::mojangName, map -> map)); diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 330f6c79417378da855326b4da665f9d240e748d..24a232c2483b5678ecc40a75a638259c3e935e93 100644 +index e92864ecf32dd984f6f87f7b05341e43af3a2977..e60a8eb7d0ff59cf3808020c84bae92a6824347c 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -136,60 +136,60 @@ public class Commands { +@@ -137,60 +137,60 @@ public class Commands { public Commands(Commands.CommandSelection environment, CommandBuildContext commandRegistryAccess) { this(); // CraftBukkit @@ -161,7 +161,7 @@ index 330f6c79417378da855326b4da665f9d240e748d..24a232c2483b5678ecc40a75a638259c WeatherCommand.register(this.dispatcher); WorldBorderCommand.register(this.dispatcher); if (JvmProfiler.INSTANCE.isAvailable()) { -@@ -201,18 +201,18 @@ public class Commands { +@@ -202,18 +202,18 @@ public class Commands { } if (environment.includeDedicated) { @@ -190,7 +190,7 @@ index 330f6c79417378da855326b4da665f9d240e748d..24a232c2483b5678ecc40a75a638259c WhitelistCommand.register(this.dispatcher); } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..9281ba58a4b4d3387ff0fb2ba717582e5ffa2bf8 100644 +index a821cb33fbc29109aec68f9d6a0eb2efc121ee13..561bd260592de9096493068e1bf47d03d12ba9a4 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -12,8 +12,11 @@ import java.io.File; @@ -232,7 +232,7 @@ index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..9281ba58a4b4d3387ff0fb2ba717582e /* CraftBukkit start - Replace everything OptionParser optionparser = new OptionParser(); OptionSpec optionspec = optionparser.accepts("nogui"); -@@ -105,15 +115,13 @@ public class Main { +@@ -105,8 +115,6 @@ public class Main { */ // CraftBukkit end try { @@ -241,7 +241,8 @@ index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..9281ba58a4b4d3387ff0fb2ba717582e if (optionset.has("jfrProfile")) { // CraftBukkit JvmProfiler.INSTANCE.start(Environment.SERVER); } - +@@ -124,7 +132,7 @@ public class Main { + // Paper end Bootstrap.bootStrap(); Bootstrap.validate(); - Util.startTimerHackThread(); @@ -249,7 +250,7 @@ index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..9281ba58a4b4d3387ff0fb2ba717582e Path path = Paths.get("server.properties"); DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support -@@ -182,6 +190,10 @@ public class Main { +@@ -193,6 +201,10 @@ public class Main { } // Paper end - fix SPIGOT-5824 Services services = Services.create(new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY), file, userCacheFile, optionset); // Paper @@ -260,7 +261,7 @@ index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..9281ba58a4b4d3387ff0fb2ba717582e // CraftBukkit start String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); -@@ -208,7 +220,7 @@ public class Main { +@@ -219,7 +231,7 @@ public class Main { PackRepository resourcepackrepository = ServerPacksSource.createPackRepository(convertable_conversionsession.getLevelPath(LevelResource.DATAPACK_DIR)); // CraftBukkit start @@ -269,7 +270,7 @@ index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..9281ba58a4b4d3387ff0fb2ba717582e if (!bukkitDataPackFolder.exists()) { bukkitDataPackFolder.mkdirs(); } -@@ -222,7 +234,7 @@ public class Main { +@@ -233,7 +245,7 @@ public class Main { + "}\n", mcMeta, com.google.common.base.Charsets.UTF_8); } catch (java.io.IOException ex) { throw new RuntimeException("Could not initialize Bukkit datapack", ex); @@ -306,7 +307,7 @@ index 710ca7d3a5659953f64bc6dccdd93b43300961cc..2f638447e1f21e93fc9dd07e3870e22b } diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 51b3db0b6c2cede95b584268e035c0fb36d38094..777e205f57c94e569e0d52293abe729743cc09c9 100644 +index a7e133f3495e9132a5fdae2c24f225e7b026295a..4efe15c981094134c11122d7566917f337be482d 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -17,6 +17,7 @@ import java.util.Collections; @@ -809,10 +810,10 @@ index 5049e969e06f4cc1826378249548064042c28410..4427ba72ab3963af71150e70aa6101ee } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bfc4ee36befb925ab4eb6b96f5c1aa6c76bf711f..31d33f590537703da7b5bee4c367cc51fe035732 100644 +index 621919a4a45caa73a43020fdca24764d95d89fd2..cb6e61f39e8847c6b15fe570fafac59241265e71 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -411,7 +411,7 @@ public final class CraftServer implements Server { +@@ -413,7 +413,7 @@ public final class CraftServer implements Server { try { this.configuration.save(this.getConfigFile()); } catch (IOException ex) { @@ -821,7 +822,7 @@ index bfc4ee36befb925ab4eb6b96f5c1aa6c76bf711f..31d33f590537703da7b5bee4c367cc51 } } -@@ -419,7 +419,7 @@ public final class CraftServer implements Server { +@@ -421,7 +421,7 @@ public final class CraftServer implements Server { try { this.commandsConfiguration.save(this.getCommandsConfigFile()); } catch (IOException ex) { @@ -830,7 +831,7 @@ index bfc4ee36befb925ab4eb6b96f5c1aa6c76bf711f..31d33f590537703da7b5bee4c367cc51 } } -@@ -503,7 +503,7 @@ public final class CraftServer implements Server { +@@ -483,7 +483,7 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); if (!io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) this.loadCustomPermissions(); // Paper