-
Notifications
You must be signed in to change notification settings - Fork 405
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 support for partially synced client tags #3118
Conversation
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric/api/tag/client/v1/ClientTags.java
Outdated
Show resolved
Hide resolved
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric/api/tag/client/v1/ClientTags.java
Outdated
Show resolved
Hide resolved
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric/api/tag/client/v1/ClientTags.java
Outdated
Show resolved
Hide resolved
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric/api/tag/client/v1/ClientTags.java
Outdated
Show resolved
Hide resolved
...client-tags-api-v1/src/client/java/net/fabricmc/fabric/impl/tag/client/ClientTagsLoader.java
Outdated
Show resolved
Hide resolved
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric/api/tag/client/v1/ClientTags.java
Outdated
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.
Looks great 👍 I just have a few questions/nit picks.
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric/api/tag/client/v1/ClientTags.java
Outdated
Show resolved
Hide resolved
...tags-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/tag/client/v1/ClientTagTest.java
Outdated
Show resolved
Hide resolved
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric/api/tag/client/v1/ClientTags.java
Outdated
Show resolved
Hide resolved
Co-authored-by: modmuss <modmuss50@gmail.com>
Your change to the recursion handling means that nested tags won't be correctly overridden anymore, as far as I can tell. |
Good catch. I've restored the recursive search, but added tracking of already tested tags so we should now always terminate. |
...c-client-tags-api-v1/src/client/java/net/fabricmc/fabric/impl/tag/client/ClientTagsImpl.java
Show resolved
Hide resolved
...client-tags-api-v1/src/client/java/net/fabricmc/fabric/impl/tag/client/ClientTagsLoader.java
Outdated
Show resolved
Hide resolved
* Draft v1.1.0 * Resolve some comments * Add javadoc * Remove old behavior * Minor cleanup * Add test for partially synced tags * Address nitpick * Fix checkstyle * Hard fail when datapack fails to regsiter Co-authored-by: modmuss <modmuss50@gmail.com> * Fix missing import * Refactor Don't recurse through tag hierarchy * Add note for test * Adjustments to logic to handle server-missing nested tags * Restore recursive search, add tracking of checked tags * Cleanup --------- Co-authored-by: modmuss <modmuss50@gmail.com>
Allows for client tags to reference tags that may be synced from a server, allowing for them to be used.
An example of this being useful is in AutoSwitch. To address
mc:sword_efficient
not containing bamboo, a wrapper tag is neededas:sword_efficient
. With partially synced tags it would allow for server-side changes tomc:sword_efficient
to be seen inas:sword_efficient
, which better reflects the intent of the tag.This is a draft as implementation is worked out, some todos are left in with some questions.