Skip to content

Editor truncates long host and biome filter values to 32 characters #243

Description

@SkyBlade1978

Summary

Long host/filter values are truncated when an OreSpawn editor screen is reopened. Manual testing found this on Minecraft 1.20.1, and a source/target-widget audit confirms the same defect on every active OreSpawn 4 Forge and NeoForge branch.

The manual report described a cutoff after roughly 25 visible characters. The actual model cutoff is 32 characters.

Reproduction

  1. Open an ore dimension or fluid-deposit dimension editor.
  2. Enter a host value/list longer than 32 characters, for example:
    • minecraft:light_gray_concrete_powder (36 characters), or
    • minecraft:deepslate_ore_replaceables (36 characters).
  3. Save and reopen the child editor.
  4. The field contains only its first 32 characters.

Pressing Cancel after reopening leaves the original profile value alone. Pressing Done can persist the shortened value:

  • OreDimensionScreen sees the shortened field as different from the original full string and writes it.
  • FluidDepositDimensionScreen always writes the shortened host/biome lists.

A cut identifier can remain syntactically valid while resolving to nothing, so this may silently change generation rather than always showing an error.

Root cause

Minecraft text widgets start with a maximum length of 32. These OreSpawn factories load the saved value before raising the intended limit:

box.setValue(value);
box.setMaxLength(1024);

setValue has already applied substring(0, 32) by the time the limit is increased.

Confirmed at Forge 1.20.1 MMD commit 240882257761 by a disposable focused JUnit probe using the target EditBox. The widget held exactly the first 32 characters. Mapped bytecode confirms the same 32-character default/substr behavior in modern EditBox and legacy Forge 1.10.2 GuiTextField.

Current 1.20.1 source sites:

Affected inputs

Eight long-form inputs are affected:

  • Ore dimension: host_blocks, host_tags
  • Fluid deposit: host_blocks, host_tags, biome_ids, excluded_biome_ids, biome_dictionary, excluded_biome_dictionary

The rest of the client text-field initialization sites were audited. Block-picker and registry/dimension ID fields set their larger limit before loading text. Weight, numeric, rock and geome fields use deliberate 24/32-character limits. No other 1024-character field factory was found.

Branch index

All three vulnerable factory sites are present at these current MMD tips:

Branch Version Tip
master-1.10.2 4.0.6.110021 583b8f7f8f59
master-1.12.2 4.0.7.112021 8b328535d8de
master-1.13.2 4.0.6.113021 5c935573ef3f
master-1.14.4 4.0.6.114041 4a3c30c1158a
master-1.15.2 4.0.6.115021 5777543ceaf4
master-1.16.5 4.0.6.116051 81946fc59050
master-1.17.1 4.0.6.117011 cd1b61e5a10c
master-1.18 4.0.6.118021 7e17a04b1495
master-1.19 4.0.6.119041 cd042467a139
master-1.20.1 4.0.6.120011 240882257761
master-1.20.6 4.0.6.120061 bdf7cf8f758f
master-1.20.6-neo 4.0.6.120062 5efdcfa36deb
master-1.21.1 4.0.6.121011 18b9950d0a62
master-1.21.1-neo 4.0.6.121012 42cf33862e62
master-1.21.11 4.0.6.121111 cd8524125831
master-1.21.11-neo 4.0.6.121112 680e90744d64
master-26.1.2 4.0.6.2601021 ec4791bd6427
master-26.1.2-neo 4.0.6.2601022 2e276fab0d66
master-26.2 4.0.6.2602001 f37ad791d0cb
master-26.2-neo 4.0.6.2602002 44a5cbf615fa

Historical OS1/OS3 and pre-1.10 branches do not contain this OreSpawn 4 editor.

Acceptance coverage for a future fix

No production fix was made during this investigation. A regression should:

  1. initialize every affected field with a valid value/list longer than 32 characters;
  2. prove the whole value survives screen initialization;
  3. save without edits and prove profile JSON remains unchanged;
  4. cover both a single long identifier and a comma-separated list;
  5. cover the legacy Forge widget wrapper, modern EditBox, and NeoForge equivalents.

The likely code change is small—set the intended maximum before setValue—but it should be carried with this regression across all affected branches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions