Run 'freeze' listeners before tag events (#11606)

This commit is contained in:
Jake Potrebic 2024-11-23 10:52:00 -08:00
parent 89bd3e5c99
commit c72a463cb5
2 changed files with 9 additions and 4 deletions

View File

@ -1204,10 +1204,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ list.forEach(loader -> loadable.apply((RegistryDataLoader.Loader<?>)loader, registryInfoLookup, conversions));
list.forEach(loader -> {
Registry<?> registry = loader.registry();
+ io.papermc.paper.registry.PaperRegistryListenerManager.INSTANCE.runFreezeListeners(loader.registry.key(), conversions); // Paper - run pre-freeze listeners
try {
registry.freeze();
@@ -0,0 +0,0 @@ public class RegistryDataLoader {
}
@ -1243,6 +1240,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} catch (Exception var15) {
errors.put(
resourceKey,
@@ -0,0 +0,0 @@ public class RegistryDataLoader {
}
}
+ io.papermc.paper.registry.PaperRegistryListenerManager.INSTANCE.runFreezeListeners(registry.key(), conversions); // Paper - run pre-freeze listeners
TagLoader.loadTagsForRegistry(resourceManager, registry);
}
@@ -0,0 +0,0 @@ public class RegistryDataLoader {
RegistryOps.RegistryInfoLookup infoGetter,
WritableRegistry<E> registry,

View File

@ -465,9 +465,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/resources/RegistryDataLoader.java
+++ b/src/main/java/net/minecraft/resources/RegistryDataLoader.java
@@ -0,0 +0,0 @@ public class RegistryDataLoader {
}
}
io.papermc.paper.registry.PaperRegistryListenerManager.INSTANCE.runFreezeListeners(registry.key(), conversions); // Paper - run pre-freeze listeners
- TagLoader.loadTagsForRegistry(resourceManager, registry);
+ TagLoader.loadTagsForRegistry(resourceManager, registry, io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.INITIAL); // Paper - tag lifecycle - add cause
}