Send three real heightmaps instead of one repeated three times
writeHeightmaps computed "highest non-air" once and wrote the same 37 longs under all three ids, on the stated assumption that our terrain has no leaves or transparency. That stopped being true the moment the generator grew trees and flowers. Vanilla's three client heightmaps stop at different blocks: WORLD_SURFACE at the first thing that is not air, MOTION_BLOCKING at the first that blocks motion or holds fluid, MOTION_BLOCKING_NO_LEAVES at the first such thing that is not a LeavesBlock -- an instanceof, not the minecraft:leaves tag. The client places rain and snow particles off MOTION_BLOCKING and lands a fishing bobber on it, so a tree canopy reported as solid ground rains under itself. Neither blocksMotion() nor the leaves test is derivable from blocks.json: the first reads cached VoxelShape collision geometry and the forceSolidOn/Off properties, the second is a Java class check. So the Java dumper grows three flag bits and the whole thing is renamed for what it now is -- block state properties, not just lighting. tools/VanillaBlockStateDump.java writes internal/world/block_properties.bin at format 2; the light bytes are unchanged byte for byte and only the previously unused high flag bits moved. Verified the dumper round trip while doing it: recompiling the old VanillaLightDump against the jar reproduces the committed binary exactly, so the data really does come from the runtime registry and not from a stale checkout. CLAUDE.md now carries the command to rebuild it.
This commit is contained in:
parent
57214fbd76
commit
7880531bdb
8 changed files with 280 additions and 48 deletions
|
|
@ -32,7 +32,7 @@ const dataVersion26 = 4790
|
|||
// first time it ran: chunkAt prefers the store over the generator, so the
|
||||
// already-explored area around spawn keeps its old terrain and every later fix
|
||||
// looks like it did nothing in exactly the place you are standing.
|
||||
const generatorVersion = 6
|
||||
const generatorVersion = 7
|
||||
|
||||
// generatorVersionTag is the NBT key holding generatorVersion. It is namespaced
|
||||
// because it is ours, not part of the vanilla chunk format.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue