Skip to content
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

Merged
merged 22 commits into from
Dec 12, 2024
Merged

Add tag aliases #4198

merged 22 commits into from
Dec 12, 2024

Conversation

Juuxel
Copy link
Member

@Juuxel Juuxel commented Nov 1, 2024

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 and c 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:

{
  "tags": [
    "minecraft:fences",
    "c:fences"
  ]
}

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:

  • Better docs
  • Tests
    • Functionality
    • Data generation

@Juuxel Juuxel marked this pull request as ready for review November 10, 2024 14:48
@Juuxel Juuxel requested a review from a team November 11, 2024 21:50
@Juuxel Juuxel added enhancement New feature or request priority:low Low priority PRs that don't immediately need to be resolved labels Nov 11, 2024
Copy link
Contributor

@apple502j apple502j left a 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

@modmuss50 modmuss50 self-requested a review November 25, 2024 09:47
Copy link
Member

@modmuss50 modmuss50 left a 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

Copy link
Member

@modmuss50 modmuss50 left a 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.

@modmuss50 modmuss50 added the last call If you care, make yourself heard right away! label Dec 5, 2024
@modmuss50 modmuss50 added the merge me please Pull requests that are ready to merge label Dec 12, 2024
@modmuss50 modmuss50 changed the base branch from 1.21.3 to 1.21.4 December 12, 2024 15:46
@modmuss50 modmuss50 changed the base branch from 1.21.4 to 1.21.3 December 12, 2024 15:46
@modmuss50 modmuss50 merged commit a730659 into FabricMC:1.21.3 Dec 12, 2024
4 checks passed
modmuss50 pushed a commit that referenced this pull request Dec 12, 2024
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request last call If you care, make yourself heard right away! merge me please Pull requests that are ready to merge priority:low Low priority PRs that don't immediately need to be resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants