fix(anvil): use 50-char name limit on 1.17+ - #3963
Open
Xuxchloris wants to merge 1 commit into
Open
Conversation
The anvil custom-name limit was raised from 35 to 50 in Minecraft 1.17, but openAnvil still rejected names longer than 35 characters on every version. Use the anvilNameLengthIsFifty minecraft-data feature to pick the correct limit. Fixes PrismarineJS#3945. Adds a version-gated external test that renames an item with a 40-char name on 1.17+ (skipped on 1.16 and below where 35 is still correct).
Author
|
The failing "MC 1.12.2 1.13.2 1.14.4 1.15.2" job is a pre-existing flake unrelated to this PR:
Could you re-run it? If it still fails I'll dig into the logs. |
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
Minecraft 1.17 raised the anvil custom-name limit from 35 to 50 characters, but
openAnvilstill rejected names longer than 35 characters on every version, breaking bots that need to rename items with names between 36 and 50 characters.Change
lib/plugins/anvil.js: compute the limit once per opened anvil from theanvilNameLengthIsFiftyminecraft-data feature (bot.supportFeature):Applies to both
anvil.combineandanvil.rename.Tests
test/externalTests/anvil.js: version-gated test that renames an item with a 40-character name (skipped on versions where the limit is still 35). The existing rename tests keep covering the short-name path on every version.Verification
standardlint clean on both changed files.