mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
239e7a6b37
RegistryAccess is independant from CraftServer and doesn't require one to be created allowing the org.bukkit.Registry class to be loaded earlier. == AT == public net.minecraft.server.RegistryLayer STATIC_ACCESS
11 lines
827 B
Diff
11 lines
827 B
Diff
--- a/net/minecraft/server/ReloadableServerRegistries.java
|
|
+++ b/net/minecraft/server/ReloadableServerRegistries.java
|
|
@@ -64,6 +64,7 @@
|
|
) {
|
|
return CompletableFuture.supplyAsync(() -> {
|
|
WritableRegistry<T> writableRegistry = new MappedRegistry<>(type.registryKey(), Lifecycle.experimental());
|
|
+ io.papermc.paper.registry.PaperRegistryAccess.instance().registerReloadableRegistry(type.registryKey(), writableRegistry); // Paper - register reloadable registry
|
|
Map<ResourceLocation, T> map = new HashMap<>();
|
|
SimpleJsonResourceReloadListener.scanDirectory(resourceManager, type.registryKey(), ops, type.codec(), map);
|
|
map.forEach((id, value) -> writableRegistry.register(ResourceKey.create(type.registryKey(), id), (T)value, DEFAULT_REGISTRATION_INFO));
|