Skip to content

Fix old-world blockstate mapping corruption on 26.3 - #708

Open
victorator wants to merge 1 commit into
MCRcortex:263from
victorator:cursor/fix-old-world-blockstate-migration-0e17
Open

victorator wants to merge 1 commit into
MCRcortex:263from
victorator:cursor/fix-old-world-blockstate-migration-0e17

Conversation

@victorator

Copy link
Copy Markdown

What corrupted old worlds

Minecraft 26.3 renamed block-state NBT from {Name, Properties} to {id, properties} (BlockStateFieldNamesFix, data version 5006; this game's data version is 5023). Saved Voxy blockstate mappings are still the old compound and did not record a data version, so BlockState.CODEC fails with "No key id".

The fallback datafixer then ran from data version 0. That reruns the 1.13 blockstate flattener. Against the real 26.3 datafixers, from-0 turns minecraft:bed into red_bed and turns a disconnected redstone_wire's none into side. Stone and oak stairs survive that path, which is why some blocks still looked fine.

When the decode still failed, the id was replaced with a random block and force-resaved. LOD sections keep those ids, so Voxy's materials no longer match the nearby Sodium chunks. The same shader pack worked on the 26.1.2 build because that version still stored {Name, Properties} and the codec succeeded. This is not a shader-pack change; no shader patches are included.

Migration

  • Each saved blockstate mapping now stores data_version.
  • Unversioned {Name, Properties} compounds are datafixed from 2531, not from 0 and not from 1451. 1451 is the flattened 1.13 schema and does skip the string flattener (minecraft:bed stays minecraft:bed), but RedstoneWireConnectionsFix is data version 2531, so starting at 1451 still rewrites disconnected redstone. Starting at 2531 does not reapply that fixer. Later migrations still run, including minecraft:chain → minecraft:iron_chain, minecraft:grass → minecraft:short_grass, and the 5006 Name/Properties → id/properties rename.
  • A failed decode stays air in memory only, so section ids stay aligned. The stored bytes are not rewritten and are not replaced with a random block. Air is not written back, including the implicit id 0.
  • A successful upgrade is resaved with the current codec and the current data_version. A mapping that already parses but has no data_version is stamped so the next game upgrade has a real baseline.

Worlds already overwritten by the random-block resave cannot be repaired from the mapping table. The original state is gone, and the LOD sections still point at those ids. Those worlds need their Voxy data rebuilt from the vanilla chunks.

Tests in MapperBlockStateMigrationTest run against the 26.3 datafixers.

Saved mappings were still {Name, Properties} with no data version, so the
26.3 codec failed. The fallback datafixer ran from version 0 and a failed
decode was replaced with a random block and resaved, permanently corrupting
LOD ids.

Store data_version on each mapping. Upgrade unversioned Name/Properties
compounds from data version 2531 so the 1.13 flattener and the redstone-wire
connection fixer do not run again, while later renames including Name->id
still do. A failed decode stays air in memory and the stored bytes are left
unchanged.

Co-authored-by: Wiktor Kasz <vittoriok@gmail.com>
@zea64

zea64 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

pull requests made with ai will not be merged
#614 (comment)

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.

3 participants