fix(anvil): use the 50 character name limit on 1.17+ - #3964
Open
AnonymoDGH wants to merge 1 commit into
Open
Conversation
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.
Fixes #3945
Problem
anvil.combineandanvil.renamerejected any custom name longer than 35 characters on every version. Since 1.17, the vanilla anvil name limit is 50 characters, so valid 36–50 character names were incorrectly refused withName is too long.Fix
minecraft-data already ships a feature flag for exactly this change —
anvilNameLengthIsFifty(1.17→ latest, added in PrismarineJS/minecraft-data#1207). This computes the limit once at plugin injection:and uses it in both
combineandrename. Behavior on ≤1.16.5 is unchanged (35).Verified
supportFeature('anvilNameLengthIsFifty')resolves tofalseon 1.8/1.12.2/1.16.5 andtrueon 1.17/1.18.2/1.20.1/1.21.1 with the installed minecraft-data (3.113.2, within the existing^3.108.0range — no dependency bump needed).bot.supportFeatureis assigned inloader.jsbefore plugins are injected, so it is available at inject time.standardlint passes on the changed file.(The anvil integration tests in
test/externalTests/anvil.jsare excluded from CI and require a live server, so no test changes are included.)