Moved 8 entity types from EntityTag.color to EntityTag.variant#2817
Open
MC-Samuel wants to merge 3 commits into
Open
Moved 8 entity types from EntityTag.color to EntityTag.variant#2817MC-Samuel wants to merge 3 commits into
MC-Samuel wants to merge 3 commits into
Conversation
tal5
requested changes
Jul 26, 2026
| case LLAMA, TRADER_LLAMA -> as(Llama.class).getColor().name(); | ||
| case PARROT -> as(Parrot.class).getVariant().name(); | ||
| case RABBIT -> { | ||
| BukkitImplDeprecations.colorToVariantProperty.warn(); |
Member
There was a problem hiding this comment.
These should obey the includeDeprecated param (as the backsupport is only for tag usage, not property output).
But, it would also be good to provide the warnings with the TagContext - I would say replace the includeDeprecated param with a nullable TagContext and then base it on that.
| if (getEntity() instanceof Wolf wolf) { | ||
| Entity entity = getEntity(); | ||
| if (entity instanceof Fox fox) { | ||
| Fox.Type foxVariant = Utilities.elementToRequiredEnumLike(variant, Fox.Type.class, mechanism); |
Member
There was a problem hiding this comment.
I think most of these actually are just enums? Can use the normal Mechanism#requireEnum logic for those
| // If the entity can have a variant, returns the list of allowed variants. | ||
| // See also <@link tag EntityTag.variant>. | ||
| // --> | ||
| PropertyParser.registerTag(EntityVariant.class, ListTag.class, "allowed_variants", (attribute, object) -> { |
…changed getColor to take an attribute and fire deprecation message if attribute is not null
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of moving some entity variants/types/colors from
EntityTag.colortoEntityTag.variant. The goal is to have EntityTag.color as primarily a DyeColor or ColorTag input rather than the current mix of DyeColors, ColorTags, ElementTags, and ListTags.Also added
EntityTag.allowed_variantsto show what variants an entity can be.