Tag Lifecycle Events

== AT ==
public net/minecraft/tags/TagEntry id
public net/minecraft/tags/TagEntry tag
public net/minecraft/tags/TagEntry required
This commit is contained in:
Jake Potrebic
2024-06-20 09:40:57 -07:00
parent 45d04f9749
commit 193eebecdf
12 changed files with 510 additions and 8 deletions

View File

@@ -42,14 +42,16 @@
} catch (Exception var14) {
errors.put(
resourceKey,
@@ -274,6 +275,7 @@
@@ -274,7 +275,8 @@
}
}
- TagLoader.loadTagsForRegistry(resourceManager, registry);
+ 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
}
static <E> void loadContentsFromNetwork(
@@ -291,6 +293,7 @@
RegistryOps<JsonElement> registryOps2 = RegistryOps.create(JsonOps.INSTANCE, infoGetter);
FileToIdConverter fileToIdConverter = FileToIdConverter.registry(registry.key());