[PR #3487] [MERGED] Gameplay reads each level's bounds from its world #5017

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

📋 Pull Request Information

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

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


📝 Commits (6)

  • c4e54ad Section caches, generation glue, distant terrain, minimap and flat worlds read the column
  • 7a082c2 Gameplay reads each level's bounds from its world
  • 0b73217 Merge main (through the carried #3485) into level-shape-7
  • 265bb90 Merge main (through the carried #3486) into level-shape-8
  • 2867be0 Merge main into level-shape-8
  • f0651e7 Dispense fixture: the world's shape follows the case's dimension

📊 Changes

58 files changed (+273 additions, -212 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+18 -6)
📝 crates/horizon-client-render/src/collisions.rs (+1 -1)
📝 crates/horizon-client-render/src/lod.rs (+2 -2)
📝 crates/horizon-client-render/src/minimap.rs (+8 -7)
📝 crates/horizon-client-render/src/world.rs (+8 -0)
📝 crates/horizon-client/src/arrows.rs (+4 -4)
📝 crates/horizon-client/src/entities/fluids.rs (+3 -3)
📝 crates/horizon-client/src/flatgen.rs (+16 -12)
📝 crates/horizon-client/src/game.rs (+15 -30)
📝 crates/horizon-client/src/game/agent.rs (+3 -2)
📝 crates/horizon-client/src/game/beacon.rs (+2 -2)
📝 crates/horizon-client/src/game/block_entity_anims.rs (+1 -1)
📝 crates/horizon-client/src/game/chat.rs (+1 -1)
📝 crates/horizon-client/src/game/commands.rs (+4 -6)
📝 crates/horizon-client/src/game/commands/execute.rs (+3 -3)
📝 crates/horizon-client/src/game/commands/terrain_cmds.rs (+3 -3)
📝 crates/horizon-client/src/game/commands/world_cmds.rs (+4 -4)
📝 crates/horizon-client/src/game/creaking.rs (+1 -1)
📝 crates/horizon-client/src/game/creatures.rs (+2 -2)
📝 crates/horizon-client/src/game/debug_keys.rs (+2 -2)

...and 38 more files

📄 Description

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

Builds on #3486 (feat/level-shape-7): until that merges, its commits show here too; this PR's own change is the commit(s) on top.

What and why

Part 8 of the level-shape series: gameplay. About 90 places used the fixed column for "where does this level start and end": void damage, build limits, spawn and surface searches, falling blocks, wind charges, commands (/spreadplayers, /fillbiome, /locate, positions), mob goals, navigation and paths, raids, villagers' POI scans, fluid scans for projectiles and items, the portal search.

  • World::bottom_y() / top_y() give the level's column. Code that used the fixed column for every dimension reads it, which keeps vanilla's behaviour exactly: the vanilla column is -64..320 in all three dimensions.
  • Code that already chose per dimension reads the level's shape: LevelAccess::min_y/max_y from world.shape, and Dim::min_y/max_y/logical_height from Dim::shape().
  • Each level's World now holds its shape (world.shape = dim.shape() where a level's world is made: opening, changing and parking levels, and a server's dimension).
  • chunk::every_section(layout) replaces the per-file [true; SECTIONS] arrays for fluid scans.

No behaviour change: every value read is the one in use today. Part 9 takes the shapes from the world's dimension types.

Vanilla reference

None

Self-check

Tests

The existing mob, motion, projectile, collision and entity tests (cargo test -p horizon-client --lib -- mobs:: motion:: arrows collisions entities::) and the game's own tests (pr_ready).

Run before this branch was rebased from upstream/main 56f968e11 onto fe3333f3f. After the rebase, CI's two clippy commands pass on it again, and pr_ready was re-run at the top of its series (#3490).

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at 56f968e11, 6 min 21 s)

Check Result
Scope ⚠️ 73 files, +1428 −556; 1819 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 23 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 8 s)
tests: horizon-client, horizon-world ❌ 1103 passed, 2 failed (3 min 12 s)
doc tests ✅ 0 passed (18 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-7) is 50 files, +149 −156, 305 lines of code.

The Python tests fail on upstream main on this Windows machine too, more often there (main 56f968e11: failures=3, errors=13; path separators, symlink privilege). CI runs them on Linux.

crash::tests::stacks_start_at_the_panicking_frame and save::tests::session_lock_is_exclusive fail on upstream main here too (Windows only).

Suggested label: skip-release.

🤖 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/3487 **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-8` --- ### 📝 Commits (6) - [`c4e54ad`](https://github.com/horizon-rust/horizon/commit/c4e54ad254e5023a6dc007f297b3bc1d5d7f11b1) Section caches, generation glue, distant terrain, minimap and flat worlds read the column - [`7a082c2`](https://github.com/horizon-rust/horizon/commit/7a082c21763ccf3eb0373c14197963fe04067a9f) Gameplay reads each level's bounds from its world - [`0b73217`](https://github.com/horizon-rust/horizon/commit/0b73217d3dd1c64499122d2903f3db646a247da2) Merge main (through the carried #3485) into level-shape-7 - [`265bb90`](https://github.com/horizon-rust/horizon/commit/265bb903d71f203b7beb8950064395473d796720) Merge main (through the carried #3486) into level-shape-8 - [`2867be0`](https://github.com/horizon-rust/horizon/commit/2867be0d53584c361725741178de46ab6c989870) Merge main into level-shape-8 - [`f0651e7`](https://github.com/horizon-rust/horizon/commit/f0651e7540c78bd37cab465f72d5ce06fbea8ab6) Dispense fixture: the world's shape follows the case's dimension ### 📊 Changes **58 files changed** (+273 additions, -212 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+18 -6) 📝 `crates/horizon-client-render/src/collisions.rs` (+1 -1) 📝 `crates/horizon-client-render/src/lod.rs` (+2 -2) 📝 `crates/horizon-client-render/src/minimap.rs` (+8 -7) 📝 `crates/horizon-client-render/src/world.rs` (+8 -0) 📝 `crates/horizon-client/src/arrows.rs` (+4 -4) 📝 `crates/horizon-client/src/entities/fluids.rs` (+3 -3) 📝 `crates/horizon-client/src/flatgen.rs` (+16 -12) 📝 `crates/horizon-client/src/game.rs` (+15 -30) 📝 `crates/horizon-client/src/game/agent.rs` (+3 -2) 📝 `crates/horizon-client/src/game/beacon.rs` (+2 -2) 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+1 -1) 📝 `crates/horizon-client/src/game/chat.rs` (+1 -1) 📝 `crates/horizon-client/src/game/commands.rs` (+4 -6) 📝 `crates/horizon-client/src/game/commands/execute.rs` (+3 -3) 📝 `crates/horizon-client/src/game/commands/terrain_cmds.rs` (+3 -3) 📝 `crates/horizon-client/src/game/commands/world_cmds.rs` (+4 -4) 📝 `crates/horizon-client/src/game/creaking.rs` (+1 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+2 -2) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+2 -2) _...and 38 more files_ </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3486 (`feat/level-shape-7`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 8 of the level-shape series: gameplay. About 90 places used the fixed column for "where does this level start and end": void damage, build limits, spawn and surface searches, falling blocks, wind charges, commands (`/spreadplayers`, `/fillbiome`, `/locate`, positions), mob goals, navigation and paths, raids, villagers' POI scans, fluid scans for projectiles and items, the portal search. - `World::bottom_y()` / `top_y()` give the level's column. Code that used the fixed column for every dimension reads it, which keeps vanilla's behaviour exactly: the vanilla column is `-64..320` in all three dimensions. - Code that already chose per dimension reads the level's shape: `LevelAccess::min_y`/`max_y` from `world.shape`, and `Dim::min_y`/`max_y`/`logical_height` from `Dim::shape()`. - Each level's `World` now holds its shape (`world.shape = dim.shape()` where a level's world is made: opening, changing and parking levels, and a server's dimension). - `chunk::every_section(layout)` replaces the per-file `[true; SECTIONS]` arrays for fluid scans. No behaviour change: every value read is the one in use today. Part 9 takes the shapes from the world's dimension types. ## Vanilla reference None ## Self-check **Tests** The existing mob, motion, projectile, collision and entity tests (`cargo test -p horizon-client --lib -- mobs:: motion:: arrows collisions entities::`) and the game's own tests (`pr_ready`). Run before this branch was rebased from upstream/main 56f968e11 onto fe3333f3f. After the rebase, CI's two clippy commands pass on it again, and pr_ready was re-run at the top of its series (#3490). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at 56f968e11, 6 min 21 s) | Check | Result | | --- | --- | | Scope | ⚠️ 73 files, +1428 −556; 1819 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 23 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 8 s) | | tests: horizon-client, horizon-world | ❌ 1103 passed, 2 failed (3 min 12 s) | | doc tests | ✅ 0 passed (18 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-7`) is 50 files, +149 −156, 305 lines of code. The Python tests fail on upstream main on this Windows machine too, more often there (main 56f968e11: failures=3, errors=13; path separators, symlink privilege). CI runs them on Linux. `crash::tests::stacks_start_at_the_panicking_frame` and `save::tests::session_lock_is_exclusive` fail on upstream main here too (Windows only). Suggested label: `skip-release`. 🤖 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:37 +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#5017
No description provided.