[PR #2482] [MERGED] Push players and entities with moving pistons #4357

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

📋 Pull Request Information

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

Base: main ← Head: fix/piston-entity-push


📝 Commits (6)

  • 6af81b6 Push entities with moving pistons
  • dca6ebb Merge upstream main into piston branch
  • bafd010 Merge remote-tracking branch 'upstream/main' into fix/piston-entity-push
  • 6384234 Stop a piston push at the world border
  • 9ab0e2b Cover the slime block's push and bounce in the LAN harness
  • 2eb96dd Merge remote-tracking branch 'upstream/main' into fix/piston-entity-push

📊 Changes

18 files changed (+1841 additions, -26 deletions)

View changed files

📝 crates/horizon-client/src/collisions.rs (+141 -5)
📝 crates/horizon-client/src/game.rs (+19 -9)
📝 crates/horizon-client/src/game/minecarts.rs (+1 -1)
📝 crates/horizon-client/src/game/moving_pistons.rs (+3 -1)
➕ crates/horizon-client/src/game/piston_push.rs (+573 -0)
📝 crates/horizon-client/src/game/remote.rs (+2 -0)
📝 crates/horizon-client/src/mobs.rs (+4 -0)
📝 crates/horizon-client/src/motion.rs (+12 -2)
📝 crates/horizon-client/src/world.rs (+4 -1)
📝 crates/horizon-world/examples/probe/main.rs (+2 -0)
➕ crates/horizon-world/examples/probe/piston_push_fixture.rs (+163 -0)
📝 crates/horizon-world/src/level/pistons.rs (+13 -5)
📝 crates/horizon-world/src/level/ticks.rs (+6 -0)
📝 crates/horizon-world/src/lib.rs (+1 -0)
➕ crates/horizon-world/src/piston_push.rs (+461 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaPistonPushOracle.java (+78 -0)
📝 tools/lan_e2e.py (+165 -2)
➕ tools/test_piston_push_parity.py (+193 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself.

What and why

A powered piston can extend through a stationary player. The piston pushes run on the server and on the client, applying the per-tick piston movement limit and the collision resolution, so a pushed body stops at a wall instead of passing through it. This also handles mobs, dropped items, boats, minecarts and non-marker armor stands, including the slime bounce and the honey drag for these bodies.

The pushed movement resolves against the world border as well, the way ordinary movement does: Entity.move collects the border's walls in collectCollidersIgnoringWorldBorder whenever WorldBorder.isInsideCloseToBorder holds, so a body pushed into the border's wall now stops there instead of being pushed through it.

Fixes #1496. Fixes #1608. Fixes #1609. Projectiles, TNT and other entity types are not covered by this change.

Vanilla reference

PistonMovingBlockEntity.tick, moveCollidedEntities, moveStuckEntities, moveEntityByPiston, fixEntityWithinPistonBase and Entity.limitPistonMovement; the slime bounce in moveCollidedEntities (its causeBounce branch) and the honey drag in moveStuckEntities. For the world border: Entity.collectCollidersIgnoringWorldBorder, CollisionGetter.borderCollision, WorldBorder.isInsideCloseToBorder and WorldBorder.getCollisionShape. piston_push compares the geometry and predicates against both 26.3 jars; piston_movement and piston_shape cover the movement limit and shape selection. The piston-push LAN check covers host, guest, stationary mob and inventory-open player on both host paths, and the world border's wall stopping a body pushed into it; piston-slime covers the slime block's push and bounce, with a plain block as the control.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, against upstream/main at d74d39cb0, 6 min 31 s)

Check Result
Scope ⚠️ 18 files, +1841 −26; 1596 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 325 passed (17 s)
rustfmt ✅ (4 s)
clippy ✅ (1 min 44 s)
tests: horizon-client, horizon-world ✅ 1548 passed (3 min 57 s)
doc tests ✅ 0 passed (26 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 268 affected, to run in CI (--quick): active_effect_tick, active_effects, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, auto_jump, bamboo, basic_feature, biome_chunk and 256 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
The branch is a merge of upstream/main and carries two further commits: the world border fix (Stop a piston push at the world border) and the piston-slime LAN case. These are the checks that were run for the branch as it stands:
Check Result
cargo fmt -p horizon-client ✅
cargo test -p horizon-client --lib -- border_movement_tests ✅ 2 passed
cargo test -p horizon-client --bin horizon-client -- game::piston_push::tests ✅ 2 passed
python3 tools/parity.py piston_push piston_movement piston_shape ✅ 3 passed, 0 failed
python3 tools/lan_e2e.py --bin-dir target/fast --check piston-push --check piston-slime ✅ both passed
python3 tools/check_public_tree.py ✅

The block above is tools/pr_ready.py --quick: the vanilla harnesses it would run are listed for CI (this machine has no vscreen, and the full run's harness step failed on a machine-side build failure while the other agents were building, not on a parity difference). The three harnesses this change can affect were run here, one by one, and the two LAN cases above were run against the built game.

🤖 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/2482 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/piston-entity-push` --- ### 📝 Commits (6) - [`6af81b6`](https://github.com/horizon-rust/horizon/commit/6af81b600f6001f9e7ce25b549028f08fb106926) Push entities with moving pistons - [`dca6ebb`](https://github.com/horizon-rust/horizon/commit/dca6ebba0e5c7fe76562bf2f8acb6affdf3a4593) Merge upstream main into piston branch - [`bafd010`](https://github.com/horizon-rust/horizon/commit/bafd010865299302b6b28d9a68deebfe8a5d2583) Merge remote-tracking branch 'upstream/main' into fix/piston-entity-push - [`6384234`](https://github.com/horizon-rust/horizon/commit/6384234e37fdd6b6bb3911e502c96c37a5e39b85) Stop a piston push at the world border - [`9ab0e2b`](https://github.com/horizon-rust/horizon/commit/9ab0e2b6a8bfa5a96de27f6fc7b05d5b990158e0) Cover the slime block's push and bounce in the LAN harness - [`2eb96dd`](https://github.com/horizon-rust/horizon/commit/2eb96ddb7cf8eb65fc035e2f1e27236481be9789) Merge remote-tracking branch 'upstream/main' into fix/piston-entity-push ### 📊 Changes **18 files changed** (+1841 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/collisions.rs` (+141 -5) 📝 `crates/horizon-client/src/game.rs` (+19 -9) 📝 `crates/horizon-client/src/game/minecarts.rs` (+1 -1) 📝 `crates/horizon-client/src/game/moving_pistons.rs` (+3 -1) ➕ `crates/horizon-client/src/game/piston_push.rs` (+573 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs.rs` (+4 -0) 📝 `crates/horizon-client/src/motion.rs` (+12 -2) 📝 `crates/horizon-client/src/world.rs` (+4 -1) 📝 `crates/horizon-world/examples/probe/main.rs` (+2 -0) ➕ `crates/horizon-world/examples/probe/piston_push_fixture.rs` (+163 -0) 📝 `crates/horizon-world/src/level/pistons.rs` (+13 -5) 📝 `crates/horizon-world/src/level/ticks.rs` (+6 -0) 📝 `crates/horizon-world/src/lib.rs` (+1 -0) ➕ `crates/horizon-world/src/piston_push.rs` (+461 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaPistonPushOracle.java` (+78 -0) 📝 `tools/lan_e2e.py` (+165 -2) ➕ `tools/test_piston_push_parity.py` (+193 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself. ## What and why A powered piston can extend through a stationary player. The piston pushes run on the server and on the client, applying the per-tick piston movement limit and the collision resolution, so a pushed body stops at a wall instead of passing through it. This also handles mobs, dropped items, boats, minecarts and non-marker armor stands, including the slime bounce and the honey drag for these bodies. The pushed movement resolves against the world border as well, the way ordinary movement does: `Entity.move` collects the border's walls in `collectCollidersIgnoringWorldBorder` whenever `WorldBorder.isInsideCloseToBorder` holds, so a body pushed into the border's wall now stops there instead of being pushed through it. Fixes #1496. Fixes #1608. Fixes #1609. Projectiles, TNT and other entity types are not covered by this change. ## Vanilla reference `PistonMovingBlockEntity.tick`, `moveCollidedEntities`, `moveStuckEntities`, `moveEntityByPiston`, `fixEntityWithinPistonBase` and `Entity.limitPistonMovement`; the slime bounce in `moveCollidedEntities` (its `causeBounce` branch) and the honey drag in `moveStuckEntities`. For the world border: `Entity.collectCollidersIgnoringWorldBorder`, `CollisionGetter.borderCollision`, `WorldBorder.isInsideCloseToBorder` and `WorldBorder.getCollisionShape`. `piston_push` compares the geometry and predicates against both 26.3 jars; `piston_movement` and `piston_shape` cover the movement limit and shape selection. The `piston-push` LAN check covers host, guest, stationary mob and inventory-open player on both host paths, and the world border's wall stopping a body pushed into it; `piston-slime` covers the slime block's push and bounce, with a plain block as the control. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, against upstream/main at d74d39cb0, 6 min 31 s) | Check | Result | | --- | --- | | Scope | ⚠️ 18 files, +1841 −26; 1596 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 325 passed (17 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (1 min 44 s) | | tests: horizon-client, horizon-world | ✅ 1548 passed (3 min 57 s) | | doc tests | ✅ 0 passed (26 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 268 affected, to run in CI (--quick): active_effect_tick, active_effects, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, auto_jump, bamboo, basic_feature, biome_chunk and 256 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The branch is a merge of `upstream/main` and carries two further commits: the world border fix (`Stop a piston push at the world border`) and the `piston-slime` LAN case. These are the checks that were run for the branch as it stands: | Check | Result | | --- | --- | | `cargo fmt -p horizon-client` | ✅ | | `cargo test -p horizon-client --lib -- border_movement_tests` | ✅ 2 passed | | `cargo test -p horizon-client --bin horizon-client -- game::piston_push::tests` | ✅ 2 passed | | `python3 tools/parity.py piston_push piston_movement piston_shape` | ✅ 3 passed, 0 failed | | `python3 tools/lan_e2e.py --bin-dir target/fast --check piston-push --check piston-slime` | ✅ both passed | | `python3 tools/check_public_tree.py` | ✅ | The block above is `tools/pr_ready.py --quick`: the vanilla harnesses it would run are listed for CI (this machine has no `vscreen`, and the full run's harness step failed on a machine-side build failure while the other agents were building, not on a parity difference). The three harnesses this change can affect were run here, one by one, and the two LAN cases above were run against the built game. 🤖 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:16:34 +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#4357
No description provided.