From 5c36e5e6b5b668083e9c176a7d00db8a39d991c6 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:59:29 -0500 Subject: [PATCH] net/minecraft/core/registries --- .../registries/BuiltInRegistries.java.patch | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) rename paper-server/patches/{unapplied => sources}/net/minecraft/core/registries/BuiltInRegistries.java.patch (83%) diff --git a/paper-server/patches/unapplied/net/minecraft/core/registries/BuiltInRegistries.java.patch b/paper-server/patches/sources/net/minecraft/core/registries/BuiltInRegistries.java.patch similarity index 83% rename from paper-server/patches/unapplied/net/minecraft/core/registries/BuiltInRegistries.java.patch rename to paper-server/patches/sources/net/minecraft/core/registries/BuiltInRegistries.java.patch index d363add98b..bc224c349b 100644 --- a/paper-server/patches/unapplied/net/minecraft/core/registries/BuiltInRegistries.java.patch +++ b/paper-server/patches/sources/net/minecraft/core/registries/BuiltInRegistries.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/core/registries/BuiltInRegistries.java +++ b/net/minecraft/core/registries/BuiltInRegistries.java -@@ -296,6 +296,17 @@ +@@ -296,6 +_,17 @@ public static final Registry> SLOT_DISPLAY = registerSimple(Registries.SLOT_DISPLAY, SlotDisplays::bootstrap); public static final Registry RECIPE_BOOK_CATEGORY = registerSimple(Registries.RECIPE_BOOK_CATEGORY, RecipeBookCategories::bootstrap); public static final Registry> REGISTRY = WRITABLE_REGISTRY; @@ -16,18 +16,17 @@ + }); + // Paper end - add built-in registry conversions - private static Registry registerSimple(ResourceKey> key, BuiltInRegistries.RegistryBootstrap initializer) { - return internalRegister(key, new MappedRegistry<>(key, Lifecycle.stable(), false), initializer); -@@ -323,14 +334,22 @@ - ResourceKey> key, R registry, BuiltInRegistries.RegistryBootstrap initializer + private static Registry registerSimple(ResourceKey> key, BuiltInRegistries.RegistryBootstrap bootstrap) { + return internalRegister(key, new MappedRegistry<>(key, Lifecycle.stable(), false), bootstrap); +@@ -321,6 +_,7 @@ + ResourceKey> key, R registry, BuiltInRegistries.RegistryBootstrap bootstrap ) { Bootstrap.checkBootstrapCalled(() -> "registry " + key.location()); + io.papermc.paper.registry.PaperRegistryAccess.instance().registerRegistry(registry.key(), registry); // Paper - initialize API registry ResourceLocation resourceLocation = key.location(); - LOADERS.put(resourceLocation, () -> initializer.run(registry)); -- WRITABLE_REGISTRY.register((ResourceKey>)key, registry, RegistrationInfo.BUILT_IN); -+ WRITABLE_REGISTRY.register((ResourceKey)key, registry, RegistrationInfo.BUILT_IN); // Paper - decompile fix - return registry; + LOADERS.put(resourceLocation, () -> bootstrap.run(registry)); + WRITABLE_REGISTRY.register((ResourceKey)key, registry, RegistrationInfo.BUILT_IN); +@@ -328,7 +_,14 @@ } public static void bootStrap() { @@ -42,7 +41,7 @@ freeze(); validate(REGISTRY); } -@@ -348,6 +367,7 @@ +@@ -346,6 +_,7 @@ for (Registry registry : REGISTRY) { bindBootstrappedTagsToEmpty(registry);