Skip to content

Add DefaultedTag #2592

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

Open
wants to merge 4 commits into
base: api-14
Choose a base branch
from

Conversation

MrHell228
Copy link
Contributor

SpongeAPI | Sponge

Changes:

  • Adds DefaultedTag which allows to remove hardcoded registries from Taggable and keep convenient Taggable#is(Tag) (which was changed to #is(DefaultedTag)).
  • All generated built-in tags are now DefaultedTags instead of just Tags.
  • Taggable#tags requires DefaultedRegistryType
  • Changes return type of Taggable#tags and Registry#taggedValues to Stream.

Impl needs to compare vanilla TagKeys and sponge DefaultedTags. It could be done with simple Comparator<Tag> but I think it would be better for Tag to just implement Comparable. Also it would make sense for RegistryKey and RegistryType to be Comparable as well because they are simply combinations of comparable ResourceKeys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant