Skip to content

Read 26.3 worlds: the new block palette format and the 26.3 blocks - #317

Open
marensovich wants to merge 3 commits into
jmc2obj:masterfrom
marensovich:fix-26.3-block-palettes
Open

marensovich wants to merge 3 commits into
jmc2obj:masterfrom
marensovich:fix-26.3-block-palettes

Conversation

@marensovich

@marensovich marensovich commented Nov 16, 2026 •

Copy link
Copy Markdown

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.

Uncaught exception in thread: ReadThread-0
java.lang.ClassCastException: class org.jmc.NBT.TAG_String cannot be cast to class org.jmc.NBT.TAG_Compound
	at org.jmc.Chunk$SectionBlocks.fillBlocks(Chunk.java:513)

Cause

26.3 snapshot 7 (data version 5009) changed the section block palette:

  • Name/Properties are now id/properties;
  • properties is left out for a block in its default state;
  • such an entry may be just the block id: a plain string in a list of strings, or {"": id} in a list that mixes strings and compounds.

fillBlocks casts every palette entry to a compound and reads Name, so it throws on the first string entry.

Change

SectionBlocks.paletteBlock() turns one palette entry into a BlockData. It accepts a bare string, {"": id}, {id, properties} and the old {Name, Properties}. Both branches of fillBlocks use 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:

exit uncaught exceptions faces in the .obj
master (32a3fde) 0 ClassCastException in both ReadThreads 0
this branch 0 none 42,619

I 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.conf entries 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 are transparent, and the rest have none.

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:

unknown-block log lines faces
palette fix only 17 492
with blocks.conf 0 529

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 with Done!.

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.DefaultStates loads it once, and paletteBlock() 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:

faces
without defaults 50
with defaults 599
same blocks with their properties written out 598

AI disclosure: Claude Code helped me find the cause and write this change.

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.
@marensovich marensovich changed the title Read the 26.3 block palette format Read 26.3 worlds: the new block palette format and the 26.3 blocks Nov 16, 2026
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

No deployments
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.

1 participant