Entity types: legacy spigot names support #2768
Open
+91
−36
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.
Adds legacy Spigot names support for entity types.
Changes
EntityTag#valueOf
, when failing to match an entity type, now tries updating the type name and fetching again (if the config option is enabled and 1.20+).EntityTag#advancedMatches
now tries updating the matcher text and comparing it against the entity type, if all other matching fails and the server is 1.20+ with the config option enabled.server
tags by referencing the Minecraft wiki instead of the Spigot JD.String#toUpperCase
usage inDenizenEntityType
withCoreUtilities#toUpperCase
.NMSHandler#updateLegacyName
on 1.20.Note
The matcher back-support only allows full name matching - can theoretically implement support for more dynamic matchers, but It'd be more annoying to do.
There's also stuff like
EntityTag.entity_type
which now returns the modern name, not sure how we want to handle back-support there (if at all).Could make the tag return legacy names and deprecate it in favor of a new one to return the modern names, but that's a very big & annoying deprecation :/.