Repository navigation
Decode saved section palettes directly - #615
Merged
Merged
Conversation
Saved block state and biome sections are decoded from their palette list and packed data without vanilla's container codecs. Each distinct palette entry is decoded once with the element codec and cached. Packed data stored as a long array is used without copying, so snapshots keep the source arrays; other numeric lists that vanilla accepts are read through NbtOps. Like vanilla, entries that fail to decode use their partial result or the default value and are logged once per section, and sections with missing or invalid data fail to read. Snapshots store their own read-only section data instead of PalettedContainers, which avoids Paper's different unpack signature.
jpenilla
added a commit
that referenced
this pull request
Oct 16, 2026
Saved block state and biome sections are decoded from their palette list and packed data without vanilla's container codecs. Each distinct palette entry is decoded once with the element codec and cached. Packed data stored as a long array is used without copying, so snapshots keep the source arrays; other numeric lists that vanilla accepts are read through NbtOps. Like vanilla, entries that fail to decode use their partial result or the default value and are logged once per section, and sections with missing or invalid data fail to read. Snapshots store their own read-only section data instead of PalettedContainers, which avoids Paper's different unpack signature. (cherry picked from commit b4a7f23)
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.
Saved-chunk snapshots no longer run vanilla's block state and biome container codecs.
SectionDecoderreads the palette list and packed data itself, decoding each distinct palette entry once and caching it, and keeps the packedlong[]as-is instead of copying it into aPalettedContainer. Snapshots now hold their own read-onlySectionDatarather thanPalettedContainers, which also avoids Paper's differentunpacksignature.Behavior matches vanilla: entries that fail to decode use their partial result or the default value, logged once per section; missing or invalid data fails the read; data stored as a numeric list rather than a long array is read through
NbtOps.SectionDecoderTestchecks these cases and a range of palette sizes against vanilla's codecs, so Minecraft updates that change vanilla's behavior should fail the tests.Performance