[PR #3488] [MERGED] Each level's shape from the world's dimension types, local and remote #5018

Closed
opened 2026-11-03 05:09:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3488
Author: @ThatCakeIsAPie
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

Base: main ← Head: feat/level-shape-9


📝 Commits (10+)

  • 8e445b4 Merge the data pack worldgen series (feat/datapack-worldgen-4) under the level-shape series
  • 72317bb Worldgen: a level's build range from its dimension type, a data pack's over vanilla's
  • 0a72ffb Each level's shape from the world's dimension types, local and remote
  • c3daaa8 Worldgen: data packs' block state providers join the state_providers bundle
  • 3b58497 Merge main (through the carried #3487) into level-shape-9
  • cc1e38e Merge branch 'pt1-3487' into pt1-3488
  • 21ecb7f Merge branch 'pt1-3487' into pt1-3488
  • 32bb54e Merge remote-tracking branch 'origin/main' into pt1-3488
  • 736d220 native_world_read: a block's bounds are its world's
  • 6e5d821 native_world_read: rustfmt

📊 Changes

23 files changed (+372 additions, -107 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+37 -0)
📝 crates/horizon-client-render/src/datapack.rs (+7 -9)
📝 crates/horizon-client/src/game.rs (+9 -15)
📝 crates/horizon-client/src/game/consume.rs (+3 -3)
📝 crates/horizon-client/src/game/dedicated.rs (+2 -0)
📝 crates/horizon-client/src/game/initial_spawn.rs (+1 -1)
📝 crates/horizon-client/src/game/integrated.rs (+2 -0)
📝 crates/horizon-client/src/game/lan.rs (+2 -0)
📝 crates/horizon-client/src/game/levels.rs (+2 -1)
📝 crates/horizon-client/src/game/minecarts.rs (+1 -1)
📝 crates/horizon-client/src/game/native_world_read.rs (+12 -11)
📝 crates/horizon-client/src/game/remote.rs (+17 -3)
📝 crates/horizon-client/src/game/remote_chunks.rs (+8 -0)
📝 crates/horizon-client/src/game/render_tick.rs (+1 -1)
📝 crates/horizon-client/src/game/world_loading.rs (+52 -5)
📝 crates/horizon-client/src/lan/conn.rs (+1 -1)
📝 crates/horizon-client/src/lan/data.rs (+65 -8)
📝 crates/horizon-client/src/lan/hub.rs (+5 -14)
📝 crates/horizon-client/src/lan/mod.rs (+4 -0)
📝 crates/horizon-client/tests/lan_bot.rs (+1 -0)

...and 3 more files

📄 Description

🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself.

Builds on #3487 (feat/level-shape-8) and #3479 (feat/datapack-worldgen-4): until they merge, their commits show here too; this PR's own change is the commit(s) on top.

What and why

Part 9 of the level-shape series, where the two series meet. Parts 1–8 made every subsystem read a level's shape. The data-pack worldgen series made a world's packs reach generation, at vanilla heights. This part takes each level's shape from its dimension type, a data pack's over vanilla's. A world with To The Max's Overworld (min_y -64, height 2096) is then 2032 blocks high, in single player and over LAN.

Two commits:

  1. Worldgen. A pack's dimension_type/<id>.json joins the overrides (DIMENSION_TYPES). LevelHeight is a dimension type's build range, logical height and skylight, checked as its codec checks them. WorldgenOverrides::level_height gives a vanilla level's, from the type its level stem names. The generator takes the level's range from the same data, and the fixed dimension_type_height table goes. So a pack's taller type no longer clamps the noise, and datapack::worldgen_overrides stops reporting dimension types as left out.
  2. The game. Opening a world reads its levels' shapes (world_loading::level_shapes), and the game keeps them (Game.level_shapes). Each level's World, SaveDir, streaming and flat terrain get its shape, and teleports and the portal search read a level's logical height from them. A host encodes each level at its shape (HubConfig.levels). It also sends the data of a dimension type the packs changed even to a client that knows the vanilla pack (NetConfig.levels, SyncData::registry_packets). Single player runs through the integrated server, so this is what makes its client see the height. A remote client takes each level's shape and its chunks' column from the server's dimension type, which now carries logical_height. The vanilla End's fallback has sky light, as 26.3's the_end.json does (DimensionType::vanilla said it had none).

Vanilla worlds read vanilla's types, and a vanilla server sends them, so nothing changes there.

Open PRs nearby: #3300 edits nearby lines of game.rs. The overlap is in text only, not in what they do; whichever lands second needs a rebase.

Vanilla reference

RegistryDataLoader (dimension types from the selected packs), DimensionType codec (MIN_Y, MAX_Y, Y_SIZE, the logical height check), LevelStem (a stem names its type), ClientboundRegistryDataPacket / KnownPack (a known pack's entries go without data unless they differ from it), ClientPacketListener.handleLogin/handleRespawn (the client level's height from the registry).

Self-check

Tests

  • levels_take_their_height_from_the_packs_dimension_types: vanilla's three types, a pack's taller Overworld type, a pack's level stem naming another type, and the ranges the codec refuses.
  • a_changed_dimension_type_is_sent_with_its_shape: only a type whose shape the world changed is sent with data, and the rest of it is kept.
  • enabled_packs_override_worldgen_in_order (now without the dimension type warning), and the protocol's registry tests.
  • End to end, generation at the pack's height against vanilla: part 11 (tools/fixtures/tall_datapacks).

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at fe3333f3f, 18 min 32 s)

Check Result
Scope ⚠️ 101 files, +2776 −647; 3145 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 408 run, FAILED (failures=1, skipped=2) (1 min 54 s)
rustfmt ✅ (16 s)
clippy ✅ (2 min 23 s)
tests: horizon-client, horizon-protocol, horizon-world ❌ 1123 passed, 2 failed (11 min 8 s)
doc tests ✅ 0 passed (2 min 43 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The Scope row counts the whole stack against upstream main; this PR's own part (over feat/level-shape-9~2) is 22 files, +363 −97, 459 lines of code.

test_port_publish's test_body_has_names_and_signatures_only fails on upstream main on this Windows machine too (it expects / in a path); CI runs the Python tests on Linux.

save::tests::session_lock_is_exclusive fails on upstream main here too (Windows only).

gfx::end_sky::tests::separate_draws_match_combined_celestial_pixels (GPU) failed once in the full run; run alone on this branch it passed 3 times out of 3, and it passes in the full runs of the branches above this one.

Suggested label: feature.

🤖 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/3488 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/level-shape-9` --- ### 📝 Commits (10+) - [`8e445b4`](https://github.com/horizon-rust/horizon/commit/8e445b4c3d7cb3f01678294d54f47408b8748186) Merge the data pack worldgen series (feat/datapack-worldgen-4) under the level-shape series - [`72317bb`](https://github.com/horizon-rust/horizon/commit/72317bb0c65d0e8486fc539af1a5d8d629ecb84b) Worldgen: a level's build range from its dimension type, a data pack's over vanilla's - [`0a72ffb`](https://github.com/horizon-rust/horizon/commit/0a72ffbf5c4dbf61aa32ca6f0db1ee329bab77b4) Each level's shape from the world's dimension types, local and remote - [`c3daaa8`](https://github.com/horizon-rust/horizon/commit/c3daaa876206b9dfbec7666b1c80f5a5679c31bf) Worldgen: data packs' block state providers join the state_providers bundle - [`3b58497`](https://github.com/horizon-rust/horizon/commit/3b584979a895efd0312323a57402c99f41c7982a) Merge main (through the carried #3487) into level-shape-9 - [`cc1e38e`](https://github.com/horizon-rust/horizon/commit/cc1e38ef22f6b41660bf824723c17df1d2b3cb4d) Merge branch 'pt1-3487' into pt1-3488 - [`21ecb7f`](https://github.com/horizon-rust/horizon/commit/21ecb7f80b77c3387d44da0e254bcef931303df3) Merge branch 'pt1-3487' into pt1-3488 - [`32bb54e`](https://github.com/horizon-rust/horizon/commit/32bb54e90c83ab5448eb763cc409a1f86b03de46) Merge remote-tracking branch 'origin/main' into pt1-3488 - [`736d220`](https://github.com/horizon-rust/horizon/commit/736d22009e5ee8882d95642eb6226d0f55829f9a) native_world_read: a block's bounds are its world's - [`6e5d821`](https://github.com/horizon-rust/horizon/commit/6e5d821eebbdaf915037871c9c3e52974c8a9956) native_world_read: rustfmt ### 📊 Changes **23 files changed** (+372 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+37 -0) 📝 `crates/horizon-client-render/src/datapack.rs` (+7 -9) 📝 `crates/horizon-client/src/game.rs` (+9 -15) 📝 `crates/horizon-client/src/game/consume.rs` (+3 -3) 📝 `crates/horizon-client/src/game/dedicated.rs` (+2 -0) 📝 `crates/horizon-client/src/game/initial_spawn.rs` (+1 -1) 📝 `crates/horizon-client/src/game/integrated.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -0) 📝 `crates/horizon-client/src/game/levels.rs` (+2 -1) 📝 `crates/horizon-client/src/game/minecarts.rs` (+1 -1) 📝 `crates/horizon-client/src/game/native_world_read.rs` (+12 -11) 📝 `crates/horizon-client/src/game/remote.rs` (+17 -3) 📝 `crates/horizon-client/src/game/remote_chunks.rs` (+8 -0) 📝 `crates/horizon-client/src/game/render_tick.rs` (+1 -1) 📝 `crates/horizon-client/src/game/world_loading.rs` (+52 -5) 📝 `crates/horizon-client/src/lan/conn.rs` (+1 -1) 📝 `crates/horizon-client/src/lan/data.rs` (+65 -8) 📝 `crates/horizon-client/src/lan/hub.rs` (+5 -14) 📝 `crates/horizon-client/src/lan/mod.rs` (+4 -0) 📝 `crates/horizon-client/tests/lan_bot.rs` (+1 -0) _...and 3 more files_ </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3487 (`feat/level-shape-8`) and #3479 (`feat/datapack-worldgen-4`)**: until they merge, their commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 9 of the level-shape series, where the two series meet. Parts 1–8 made every subsystem read a level's shape. The data-pack worldgen series made a world's packs reach generation, at vanilla heights. This part takes each level's shape from its dimension type, a data pack's over vanilla's. A world with To The Max's Overworld (`min_y -64, height 2096`) is then 2032 blocks high, in single player and over LAN. Two commits: 1. **Worldgen.** A pack's `dimension_type/<id>.json` joins the overrides (`DIMENSION_TYPES`). `LevelHeight` is a dimension type's build range, logical height and skylight, checked as its codec checks them. `WorldgenOverrides::level_height` gives a vanilla level's, from the type its level stem names. The generator takes the level's range from the same data, and the fixed `dimension_type_height` table goes. So a pack's taller type no longer clamps the noise, and `datapack::worldgen_overrides` stops reporting dimension types as left out. 2. **The game.** Opening a world reads its levels' shapes (`world_loading::level_shapes`), and the game keeps them (`Game.level_shapes`). Each level's `World`, `SaveDir`, streaming and flat terrain get its shape, and teleports and the portal search read a level's logical height from them. A **host** encodes each level at its shape (`HubConfig.levels`). It also sends the data of a dimension type the packs changed even to a client that knows the vanilla pack (`NetConfig.levels`, `SyncData::registry_packets`). Single player runs through the integrated server, so this is what makes its client see the height. A **remote client** takes each level's shape and its chunks' column from the server's dimension type, which now carries `logical_height`. The vanilla End's fallback has sky light, as 26.3's `the_end.json` does (`DimensionType::vanilla` said it had none). Vanilla worlds read vanilla's types, and a vanilla server sends them, so nothing changes there. **Open PRs nearby:** #3300 edits nearby lines of `game.rs`. The overlap is in text only, not in what they do; whichever lands second needs a rebase. ## Vanilla reference `RegistryDataLoader` (dimension types from the selected packs), `DimensionType` codec (`MIN_Y`, `MAX_Y`, `Y_SIZE`, the logical height check), `LevelStem` (a stem names its type), `ClientboundRegistryDataPacket` / `KnownPack` (a known pack's entries go without data unless they differ from it), `ClientPacketListener.handleLogin`/`handleRespawn` (the client level's height from the registry). ## Self-check **Tests** - `levels_take_their_height_from_the_packs_dimension_types`: vanilla's three types, a pack's taller Overworld type, a pack's level stem naming another type, and the ranges the codec refuses. - `a_changed_dimension_type_is_sent_with_its_shape`: only a type whose shape the world changed is sent with data, and the rest of it is kept. - `enabled_packs_override_worldgen_in_order` (now without the dimension type warning), and the protocol's registry tests. - End to end, generation at the pack's height against vanilla: part 11 (`tools/fixtures/tall_datapacks`). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at fe3333f3f, 18 min 32 s) | Check | Result | | --- | --- | | Scope | ⚠️ 101 files, +2776 −647; 3145 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 408 run, FAILED (failures=1, skipped=2) (1 min 54 s) | | rustfmt | ✅ (16 s) | | clippy | ✅ (2 min 23 s) | | tests: horizon-client, horizon-protocol, horizon-world | ❌ 1123 passed, 2 failed (11 min 8 s) | | doc tests | ✅ 0 passed (2 min 43 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The Scope row counts the whole stack against upstream main; this PR's own part (over `feat/level-shape-9~2`) is 22 files, +363 −97, 459 lines of code. `test_port_publish`'s `test_body_has_names_and_signatures_only` fails on upstream main on this Windows machine too (it expects `/` in a path); CI runs the Python tests on Linux. `save::tests::session_lock_is_exclusive` fails on upstream main here too (Windows only). `gfx::end_sky::tests::separate_draws_match_combined_celestial_pixels` (GPU) failed once in the full run; run alone on this branch it passed 3 times out of 3, and it passes in the full runs of the branches above this one. Suggested label: `feature`. 🤖 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 05:09:38 +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#5018
No description provided.