Fix old-world blockstate mapping corruption on 26.3 - #708
Open
victorator wants to merge 1 commit into
Open
victorator wants to merge 1 commit into
victorator wants to merge 1 commit into
Conversation
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>
Contributor
|
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.
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, soBlockState.CODECfails 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:bedintored_bedand turns a disconnectedredstone_wire'snoneintoside. 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
data_version.{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:bedstaysminecraft:bed), butRedstoneWireConnectionsFixis data version 2531, so starting at 1451 still rewrites disconnected redstone. Starting at 2531 does not reapply that fixer. Later migrations still run, includingminecraft:chain→minecraft:iron_chain,minecraft:grass→minecraft:short_grass, and the 5006Name/Properties→id/propertiesrename.data_version. A mapping that already parses but has nodata_versionis 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
MapperBlockStateMigrationTestrun against the 26.3 datafixers.