-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tag aliases #4198
Add tag aliases #4198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will test when I have time
...tion-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricTagProvider.java
Outdated
Show resolved
Hide resolved
fabric-tag-api-v1/src/main/java/net/fabricmc/fabric/impl/tag/TagAliasLoader.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing major standing out to me
...tion-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricTagProvider.java
Show resolved
Hide resolved
fabric-tag-api-v1/src/main/java/net/fabricmc/fabric/api/tag/v1/TagAliasGroup.java
Outdated
Show resolved
Hide resolved
fabric-tag-api-v1/src/main/java/net/fabricmc/fabric/api/tag/v1/TagAliasGroup.java
Outdated
Show resolved
Hide resolved
fabric-tag-api-v1/src/main/java/net/fabricmc/fabric/impl/tag/TagAliasLoader.java
Outdated
Show resolved
Hide resolved
fabric-tag-api-v1/src/main/java/net/fabricmc/fabric/mixin/tag/SimpleRegistryMixin.java
Outdated
Show resolved
Hide resolved
fabric-tag-api-v1/src/main/java/net/fabricmc/fabric/mixin/tag/SimpleRegistryMixin.java
Outdated
Show resolved
Hide resolved
# Conflicts: # gradle.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Just one or two minor nit picks. Ill move to last call now (expect a full week).
@TelepathicGrunt would you be able to take a quick look at the readme/package doc to make sure that it covers your use cases/looks reasonable.
fabric-tag-api-v1/src/main/java/net/fabricmc/fabric/api/tag/v1/TagAliasGroup.java
Outdated
Show resolved
Hide resolved
* Add tag aliases * Document and rename tag alias internals * Make the tag alias directory singular to match Mojang's recent style * Add a note about tag aliases to client tag documentation * Support missing tags in alias groups * Support tag aliases for dynamic and reloadable registries * TagAliasGroup: Document naming conventions for c tag alias groups * Add tag alias test mod * Fix inline return checkstyle * Add test for tag alias data generation * Fix checkstyle (again) * Add tag translations to tag API testmod * Uncomment accidentally commented out code * SimpleRegistryMixin: Improve a log message * TagAliasTest: Improve assertion messages * Fix tag aliases for dynamic registries not applying on /reload * Clean up log message once again * Address review feedback * Make missing interfaces throw CCEs * Add README * Move TagAliasGroup into the impl package (cherry picked from commit a730659)
The tag alias API lets modders merge different but equivalent tags together so that they have the same content. For example, tag aliases can be used to unify matching
minecraft
andc
tags. (This is the main purpose of the PR.)Tag aliases are defined in data packs like tags. For example, a block tag alias group for fences would be located at
data/my_mod/fabric/tag_aliases/block/fences.json
with the contents:The files can also be generated with the data generation API. Alias groups can be replaced (or disabled) like most data pack files by having a different file with the same name at the same file path.
TODO: