[PR #2070] [MERGED] Saves: Nether and End chunks keep their own height #3982

Closed
opened 2026-11-03 04:13:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2070
Author: @FusselTV
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/dimension-height


📝 Commits (1)

  • 1bbe642 Saves: Nether and End chunks keep their own height

📊 Changes

1 file changed (+153 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/save.rs (+153 -27)

📄 Description

🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally.

What and why

Chunk holds the Overworld's 24 sections in every dimension, and the save wrote them as they are. A Nether or End chunk saved by Horizon therefore had:

  • yPos: -4 instead of 0,
  • sections Y -4 to 19 instead of 0 to 15,
  • 24 PostProcessing lists instead of 16,
  • heightmaps counted from y=-64 instead of y=0.

Vanilla and Paper trust the saved heightmaps. So a Nether made by Horizon reads its surface at y=192, above the bedrock roof, and the End 64 blocks too high: spawn positions, structure placement at the edge of the generated area and everything else that asks for the surface are off. Re-saving a vanilla Nether chunk in Horizon rewrote its yPos as well.

What changes:

  • LevelShape (skylight, min_y, height of the dimension, from its folder name) replaces the sky_light flag on the save path.
  • yPos, the saved sections, the PostProcessing lists (proto chunks too) and the heightmaps follow the level's shape, as SerializableChunkData.write does.
  • Side effect: LAN clients in the Nether and End now get the chunk's heightmaps. client_heightmaps_in failed its section check there and sent them empty.

Vanilla reference

SerializableChunkData.copyOf / write (yPos = getMinSectionY, sections from getMinSectionY to getMaxSectionY, PostProcessing sized by getSectionsCount), Heightmap.setRawData / getFirstAvailable (values relative to getMinY), DimensionType min_y / height of the_nether and the_end (0, 256).

Tests

  • New unit test save::tests::nether_and_end_chunks_save_with_their_own_height. It saves a netherrack column as Nether and checks yPos 0, sections 0..15, 16 PostProcessing lists and WORLD_SURFACE 128 at y=127 (was 192). It also checks the Overworld and the folder mapping (the_end, DIM-1).
  • tools/test_heightmap_parity.py: passed on this branch (1,671,668 lines match on client and server).
  • End to end: All fixes of this series (the five save PRs and the four structure-start PRs) merged onto main and run as a dedicated server, which pre-generated seed 12345, 4,096 chunks per dimension (radius 500 blocks), and the result was compared chunk by chunk with the same area from the pinned vanilla 26.3 server (compare.py, our own world-diff tool). Then the world was opened in Paper 26.3. Paper's log shows no exception and no skipped block entity. Nether and End: all 4,624 saved chunks have yPos: 0. The Nether WORLD_SURFACE heightmaps match vanilla in every chunk. In the End, 4 chunks differ, from generation order; Paper's own End differs from vanilla in 2. In Paper, the surface at Nether 80,80 reads y=128 (the bedrock roof, as in vanilla), not 192.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on b894cf7158ff, against upstream/main at 57c5f8129, 3 min 31 s)

Check Result
Scope ✅ 1 files, +153 −27
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (6 s)
clippy ✅ (26 s)
tests: horizon-client ✅ 1296 passed (2 min 56 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 324 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 312 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2070 **Author:** [@FusselTV](https://github.com/FusselTV) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dimension-height` --- ### 📝 Commits (1) - [`1bbe642`](https://github.com/horizon-rust/horizon/commit/1bbe64265c3ae1f45d86cd204acb9b1bbb553a1e) Saves: Nether and End chunks keep their own height ### 📊 Changes **1 file changed** (+153 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/save.rs` (+153 -27) </details> ### 📄 Description > 🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally. ## What and why `Chunk` holds the Overworld's 24 sections in every dimension, and the save wrote them as they are. A Nether or End chunk saved by Horizon therefore had: - `yPos: -4` instead of `0`, - sections `Y` -4 to 19 instead of 0 to 15, - 24 `PostProcessing` lists instead of 16, - heightmaps counted from y=-64 instead of y=0. Vanilla and Paper trust the saved heightmaps. So a Nether made by Horizon reads its surface at y=192, above the bedrock roof, and the End 64 blocks too high: spawn positions, structure placement at the edge of the generated area and everything else that asks for the surface are off. Re-saving a vanilla Nether chunk in Horizon rewrote its `yPos` as well. What changes: - `LevelShape` (skylight, `min_y`, height of the dimension, from its folder name) replaces the `sky_light` flag on the save path. - `yPos`, the saved sections, the `PostProcessing` lists (proto chunks too) and the heightmaps follow the level's shape, as `SerializableChunkData.write` does. - Side effect: LAN clients in the Nether and End now get the chunk's heightmaps. `client_heightmaps_in` failed its section check there and sent them empty. ## Vanilla reference `SerializableChunkData.copyOf` / `write` (`yPos` = `getMinSectionY`, sections from `getMinSectionY` to `getMaxSectionY`, `PostProcessing` sized by `getSectionsCount`), `Heightmap.setRawData` / `getFirstAvailable` (values relative to `getMinY`), `DimensionType` `min_y` / `height` of `the_nether` and `the_end` (0, 256). ## Tests - New unit test `save::tests::nether_and_end_chunks_save_with_their_own_height`. It saves a netherrack column as Nether and checks `yPos` 0, sections 0..15, 16 `PostProcessing` lists and `WORLD_SURFACE` 128 at y=127 (was 192). It also checks the Overworld and the folder mapping (`the_end`, `DIM-1`). - `tools/test_heightmap_parity.py`: passed on this branch (1,671,668 lines match on client and server). - End to end: All fixes of this series (the five save PRs and the four structure-start PRs) merged onto `main` and run as a dedicated server, which pre-generated seed 12345, 4,096 chunks per dimension (radius 500 blocks), and the result was compared chunk by chunk with the same area from the pinned vanilla 26.3 server (`compare.py`, our own world-diff tool). Then the world was opened in Paper 26.3. Paper's log shows no exception and no skipped block entity. Nether and End: all 4,624 saved chunks have `yPos: 0`. The Nether `WORLD_SURFACE` heightmaps match vanilla in every chunk. In the End, 4 chunks differ, from generation order; Paper's own End differs from vanilla in 2. In Paper, the surface at Nether 80,80 reads y=128 (the bedrock roof, as in vanilla), not 192. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on b894cf7158ff, against upstream/main at 57c5f8129, 3 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +153 −27 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ✅ (26 s) | | tests: horizon-client | ✅ 1296 passed (2 min 56 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 324 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 312 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:46 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3982
No description provided.