Repository navigation
Read 26.3 worlds: the new block palette format and the 26.3 blocks - #317
Open
marensovich wants to merge 3 commits into
Open
marensovich wants to merge 3 commits into
marensovich wants to merge 3 commits into
Conversation
26.3 snapshot 7 changed section block palettes: Name/Properties became
id/properties, properties are left out for a default state, and an entry
may be just the block id - a string in a list of strings, or {"": id} in
a list that mixes both forms. fillBlocks cast every entry to a compound
and read "Name", so the chunk reader thread died with a
ClassCastException on any 26.3 chunk; the export still finished with
"Done!" and an empty model.
paletteBlock() reads all of these and the pre-26.3 form, and both the
single-block and the per-block branch of fillBlocks use it.
The 90 blockstates new in 26.3: the poplar wood family (logs, planks, wood, signs, door, trapdoor, fence, gate, button, pressure plate, shelf, sapling, and orange/red/yellow poplar leaves), wool and concrete slabs and stairs in all 16 colours, red shrub, shelf mushroom and straw bed. Without an entry jmc2obj still builds them from the resource pack's models but with full occlusion, so a slab, stair, leaf or plant hides the faces of the blocks next to it. Logs, planks and wood keep the default (full); leaves are transparent, as for the other leaves; the rest is none, as for their existing counterparts.
Since 26.3 a section palette entry for a block in its default state
has no properties: a grass floor, a chain, a floor lantern, an upright
log or a bottom slab is written as just its id. jmc2obj then builds the
block with an empty state, the blockstate variants match nothing, and
the block is left out of the model without a log line. Chain throws
"Missing axis value!".
conf/default-states.json holds the property values of each block's
default state, for the 884 blocks of 26.3 that have properties. It is
the default state of every block in reports/blocks.json from the
26.3 data generator (net.minecraft.data.Main --reports). DefaultStates
loads it on first use and paletteBlock() fills in the properties a
new-format entry leaves out; {Name, Properties} entries from older
worlds always list every property and are left as they are.
Tested on a generated 26.3 chunk where every palette entry is a bare
id: a grass_block floor and a row with a chain, a lantern, podzol, a
trapdoor and tall grass. grass_block_top, iron_chain, lantern,
podzol_top, spruce_trapdoor and tall_grass_bottom were missing from
the model and are now there: 599 faces instead of 50, and every
material of the same chunk written with its properties.
This branch has not been deployed
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.
26.3 worlds export as an empty model: every chunk reader thread dies on the first section, yet the export ends with
Done!and exit code 0.Cause
26.3 snapshot 7 (data version 5009) changed the section block palette:
Name/Propertiesare nowid/properties;propertiesis left out for a block in its default state;{"": id}in a list that mixes strings and compounds.fillBlockscasts every palette entry to a compound and readsName, so it throws on the first string entry.Change
SectionBlocks.paletteBlock()turns one palette entry into aBlockData. It accepts a bare string,{"": id},{id, properties}and the old{Name, Properties}. Both branches offillBlocksuse it: the single-block section and the per-block loop. Waterlogged handling and the biome palette are unchanged.Testing
I tested on a 26.3 world (data version 5023), using two chunks whose palettes contain all three new forms, exported from the command line:
ClassCastExceptionin both ReadThreadsI have not re-tested a pre-26.3 world. The old
{Name, Properties}entries go through the same lookup first, so that path should behave as before.Blocks added in 26.3
The second commit adds
conf/blocks.confentries for the 90 blockstates 26.3 adds: the poplar wood family and its orange/red/yellow leaves, wool and concrete slabs and stairs in all 16 colours, red shrub, shelf mushroom and straw bed. Logs, planks and wood are full blocks, the leaves aretransparent, and the rest havenone.Without these entries each of those blocks logs
Found unknown block. It is then exported with default properties as a full cube, which hides its neighbours' faces. I tested on a generated 26.3 chunk that holds a row of these blocks, with the 26.3 client jar as the resource pack:Blocks in their default state
Reading the new palette is not enough on its own. A block in its default state has no
properties, and jmc2obj picks a block's models by property values, so a grass block (snowy), a chain (axis), a floor lantern (hanging) or a trapdoor (half) matches no model. The block is dropped without a log line, and the export still ends withDone!.The third commit adds
conf/default-states.json: the property values of the default state of each block that has properties (884 of 1286), taken from the 26.3 data generator (net.minecraft.data.Main --reports,reports/blocks.json).org.jmc.util.DefaultStatesloads it once, andpaletteBlock()fills in the properties an entry in the new format leaves out. Values the entry has are kept, and entries in the old{Name, Properties}format are not touched.I tested on a generated 26.3 chunk: a grass block floor and a row of 16 vanilla blocks, all written as bare ids, with the 26.3 client jar as the resource pack:
AI disclosure: Claude Code helped me find the cause and write this change.