Skip to content

fix(anvil): use 50-char name limit on 1.17+ - #3963

Open
Xuxchloris wants to merge 1 commit into
PrismarineJS:masterfrom
Xuxchloris:fix/anvil-name-limit-50
Open

fix(anvil): use 50-char name limit on 1.17+#3963
Xuxchloris wants to merge 1 commit into
PrismarineJS:masterfrom
Xuxchloris:fix/anvil-name-limit-50

Conversation

@Xuxchloris

Copy link
Copy Markdown

Fixes #3945.

Problem

Minecraft 1.17 raised the anvil custom-name limit from 35 to 50 characters, but openAnvil still 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 the anvilNameLengthIsFifty minecraft-data feature (bot.supportFeature):

  • 1.17+ → 50 characters
  • 1.16 and below → 35 characters (unchanged)

Applies to both anvil.combine and anvil.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

  • standard lint clean on both changed files.
  • The new external test runs in the per-version CI matrix on 1.17+; on older versions it early-returns (35-char limit is preserved).

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).
@Xuxchloris

Copy link
Copy Markdown
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.

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.

Wrong anvil name length limit in 1.17+

1 participant