[PR #7158] [MERGED] Items, experience orbs, primed TNT and falling blocks stop at the world border #7384

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7158
Author: @Akirabane
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/7080-entity-world-border


📝 Commits (4)

  • f69a778 Items and experience orbs stop at the world border
  • 0ec75f0 Primed TNT stops at the world border
  • 832a188 Falling blocks stop at the world border
  • 2453e2d Merge remote-tracking branch 'origin/main' into fix/7080-entity-world-border

📊 Changes

7 files changed (+194 additions, -43 deletions)

View changed files

📝 crates/horizon-client-render/src/collisions.rs (+16 -15)
📝 crates/horizon-client/src/entities.rs (+83 -9)
📝 crates/horizon-client/src/entities/fluids.rs (+5 -2)
📝 crates/horizon-client/src/game.rs (+10 -2)
📝 crates/horizon-client/src/game/remote.rs (+13 -2)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+3 -2)
📝 crates/horizon-client/src/game/tnt.rs (+64 -11)

📄 Description

🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review.

Refs #7080

What was wrong

Entity.collide builds its colliders with Entity.collectColliders, which adds WorldBorder.getCollisionShape for any entity inside and close to the border (isInsideCloseToBorder; read with javap on the 26.3 server jar). #7108 passed the border to mobs; four other entities still moved against the blocks alone and went through it:

  • items: ItemEntity::tick built its EntityCollisions with border: None;
  • experience orbs: ExperienceOrb::tick used SceneCollisions::resolve;
  • primed TNT: PrimedTnt::tick used SceneCollisions::resolve;
  • falling blocks: Game::fall_step used SceneCollisions::resolve_with_context.

What changed

Three commits:

  1. Items and experience orbs stop at the world border. Both ticks take the level's border (Option<&BorderGeometry>), filled from self.border.geometry() on the server and in a client's copy (game/remote.rs), None in tests. EntityCollisions gains resolve_with_context (its resolve now calls it), and SceneCollisions::resolve_in_border uses it.
  2. Primed TNT stops at the world border. Same for PrimedTnt::tick, on the server and in tick_remote_projectiles.
  3. Falling blocks stop at the world border. fall_step resolves through EntityCollisions with the border, keeping the block's own collision context.

Not in this PR: armor stands (ArmorStand::tick, same cause) wait for #7131, which rewrites that tick. Projectiles move by their own clip, not Entity.move's colliders, so they are not concerned.

How it was checked

Unit tests, expected values from the border geometry (a border of size 10 around (20, 20), east wall at x = 25; each body starts at x = 24 on the test scene's flat ground, moving 1.5 east):

  • entities::world_border_tests::the_world_border_stops_items_and_experience_orbs: without a border the item's and the orb's boxes end past 25; with it, on 25.
  • game::tnt::tests::the_world_border_stops_primed_tnt: the same for primed TNT.

No unit test for falling blocks: fall_step needs a Game, which has no test fixture (as for boats in #7077).

In the game (horizon-ctl launch --offscreen, creative world, a stone floor at y = 100): /worldborder center 0 0 and /worldborder set 10 (walls from x = -4.5 to 5.5, collision shape rounded out to x = 6 by getCollisionShape's Math.ceil), then from x = 3, both moving east with Motion:[1.5,0.2,0.0], a stone item (/summon item) and a sand falling block (/summon falling_block). After 4 s, the item's Pos from /data get entity and where the sand landed:

Build Item x Sand landed at
origin/main (8a45d7f9f) 17.79 (through the border) x = 15 (through the border)
this branch 5.875 (its box ends on the wall at 6) x = 5 (inside)

Orbs and primed TNT were not run in game; their unit tests cover them.

Self-check

tools/pr_ready.py --quick --base origin/main (after merging main):

Check Result
Scope 7 files, +194 −43
Cargo.lock unchanged
rustfmt, clippy ✅
tests: horizon-client, horizon-client-lib, horizon-client-render ✅ 3254 passed
mod API up to date ✅
Python tests 1 error from my machine's setup, untouched here
Parity not run (--quick): the CI parity job picks the affected harnesses

🤖 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/7158 **Author:** [@Akirabane](https://github.com/Akirabane) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/7080-entity-world-border` --- ### 📝 Commits (4) - [`f69a778`](https://github.com/horizon-rust/horizon/commit/f69a77827e0c8d1a132aff9a197abb07d02bccd1) Items and experience orbs stop at the world border - [`0ec75f0`](https://github.com/horizon-rust/horizon/commit/0ec75f0dd8d8998d5aa22fe44a1e13d18881b859) Primed TNT stops at the world border - [`832a188`](https://github.com/horizon-rust/horizon/commit/832a188847ba8cfcdda3dcb1c4181bf3289ff280) Falling blocks stop at the world border - [`2453e2d`](https://github.com/horizon-rust/horizon/commit/2453e2d2c098fe8fca95ec312f68a032ea8509d6) Merge remote-tracking branch 'origin/main' into fix/7080-entity-world-border ### 📊 Changes **7 files changed** (+194 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/collisions.rs` (+16 -15) 📝 `crates/horizon-client/src/entities.rs` (+83 -9) 📝 `crates/horizon-client/src/entities/fluids.rs` (+5 -2) 📝 `crates/horizon-client/src/game.rs` (+10 -2) 📝 `crates/horizon-client/src/game/remote.rs` (+13 -2) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+3 -2) 📝 `crates/horizon-client/src/game/tnt.rs` (+64 -11) </details> ### 📄 Description > 🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review. Refs #7080 ## What was wrong `Entity.collide` builds its colliders with `Entity.collectColliders`, which adds `WorldBorder.getCollisionShape` for any entity inside and close to the border (`isInsideCloseToBorder`; read with `javap` on the 26.3 server jar). #7108 passed the border to mobs; four other entities still moved against the blocks alone and went through it: - items: `ItemEntity::tick` built its `EntityCollisions` with `border: None`; - experience orbs: `ExperienceOrb::tick` used `SceneCollisions::resolve`; - primed TNT: `PrimedTnt::tick` used `SceneCollisions::resolve`; - falling blocks: `Game::fall_step` used `SceneCollisions::resolve_with_context`. ## What changed Three commits: 1. **Items and experience orbs stop at the world border.** Both ticks take the level's border (`Option<&BorderGeometry>`), filled from `self.border.geometry()` on the server and in a client's copy (`game/remote.rs`), `None` in tests. `EntityCollisions` gains `resolve_with_context` (its `resolve` now calls it), and `SceneCollisions::resolve_in_border` uses it. 2. **Primed TNT stops at the world border.** Same for `PrimedTnt::tick`, on the server and in `tick_remote_projectiles`. 3. **Falling blocks stop at the world border.** `fall_step` resolves through `EntityCollisions` with the border, keeping the block's own collision context. Not in this PR: armor stands (`ArmorStand::tick`, same cause) wait for #7131, which rewrites that tick. Projectiles move by their own clip, not `Entity.move`'s colliders, so they are not concerned. ## How it was checked Unit tests, expected values from the border geometry (a border of size 10 around (20, 20), east wall at x = 25; each body starts at x = 24 on the test scene's flat ground, moving 1.5 east): - `entities::world_border_tests::the_world_border_stops_items_and_experience_orbs`: without a border the item's and the orb's boxes end past 25; with it, on 25. - `game::tnt::tests::the_world_border_stops_primed_tnt`: the same for primed TNT. No unit test for falling blocks: `fall_step` needs a `Game`, which has no test fixture (as for boats in #7077). In the game (`horizon-ctl launch --offscreen`, creative world, a stone floor at y = 100): `/worldborder center 0 0` and `/worldborder set 10` (walls from x = -4.5 to 5.5, collision shape rounded out to x = 6 by `getCollisionShape`'s `Math.ceil`), then from x = 3, both moving east with `Motion:[1.5,0.2,0.0]`, a stone item (`/summon item`) and a sand falling block (`/summon falling_block`). After 4 s, the item's `Pos` from `/data get entity` and where the sand landed: | Build | Item x | Sand landed at | | --- | --- | --- | | `origin/main` (8a45d7f9f) | 17.79 (through the border) | x = 15 (through the border) | | this branch | 5.875 (its box ends on the wall at 6) | x = 5 (inside) | Orbs and primed TNT were not run in game; their unit tests cover them. ## Self-check `tools/pr_ready.py --quick --base origin/main` (after merging main): | Check | Result | | --- | --- | | Scope | 7 files, +194 −43 | | Cargo.lock | unchanged | | rustfmt, clippy | ✅ | | tests: horizon-client, horizon-client-lib, horizon-client-render | ✅ 3254 passed | | mod API up to date | ✅ | | Python tests | 1 error from my machine's setup, untouched here | | Parity | not run (`--quick`): the CI parity job picks the affected harnesses | 🤖 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 06:38:43 +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#7384
No description provided.