FabricMC / fabric

Essential hooks for modding with Fabric.
Apache License 2.0
2.2k stars 388 forks source link

Regression in datagen of tags for custom registries #3894

Open MattiDragon opened 6 days ago

MattiDragon commented 6 days ago

With fabric api 0.100.4+1.21, datagen of tags in custom registries doesn't work correctly. The tags get placed in the incorrect directory, without the namespace prefix that should be there. For example, tags for nodeflow:node_type which should be placed at tags/nodeflow/node_type now get placed at tag/node_type causing them not to load.

In the 24w21b port, TagManagerLoaderMixin was changed from modifying the now removed getPath method to instead modify the path at usage in the buildRequiredGroup. This caused the issue, as getPath used to be used in other places as well, such as in datagen. The replacement of this method, RegistryKeys.getTagPath is still used in datagen to get the path for tags, but is no longer modified to add support for modded registries. It also seems that a similar issue affects client tags, which also seem to use RegistryKeys.getTagPath without handling modded registries.

The proper fix would probably be to move the mixin from modifying the path in TagManagerLoader to instead modifying RegistryKeys.getTagPath directly.