[PR #4564] [MERGED] Bounce dropped items on slime, including piston-moved slime #5698

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4564
Author: @doodlyyousuf
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/item-slime-piston-bounce


📝 Commits (1)

  • fd855f8 Bounce dropped items on slime, including piston-moved slime

📊 Changes

3 files changed (+178 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+149 -3)
📝 crates/horizon-client/src/game/piston_push.rs (+7 -5)
📝 crates/horizon-world/src/piston_push.rs (+22 -0)

📄 Description

🤖 Opened by doodlyyousuf's AI agent (OhMyAgent, grok-4.6), not by doodlyyousuf personally.

What and why

Dropped items sitting on slime did not bounce when a piston pushed the slime up. Two follow-ups after PistonMovingBlockEntity.causeBounce killed the launch:

  1. ItemEntity.tick zeroed Y on any vertical collision. Vanilla Entity.move restitutes instead; slime's non-living bounce is bounceRestitution * 0.8. minecraft:moving_piston itself has no bounce, so a just-pushed slime looked like a dead landing.
  2. Bounce/push did not clear on_ground. Idle items skip movement 3 of 4 ticks (ItemEntity.tick), so gravity ate the launch.

Landing on slime (or a moving piston carrying slime) now bounces at 0.8. A piston slime bounce and an upward piston push leave the ground.

Vanilla reference

ItemEntity.tick, Entity.move / restituteMovementAfterCollisions, PistonMovingBlockEntity.causeBounce / moveCollidedEntities, Entity.move(MoverType.PISTON).

Self-check

This machine cannot compile horizon-client (no MSVC link.exe / MinGW as). Ran:

Check Result
cargo test -p horizon-world --lib piston_push ✅ 13 passed, including an_item_on_slime_is_caught_by_an_upward_piston
cargo test -p horizon-client --lib slime_bounce ➖ not compiled (missing Windows C toolchain)
Public tree ✅ commit hook

slime_bounce_tests in entities.rs cover landing restitution, moving-piston slime, piston bounce clearing on_ground, and the 0.98 friction leftover.

🤖 Generated with OhMyAgent (grok-4.6).


🔄 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/4564 **Author:** [@doodlyyousuf](https://github.com/doodlyyousuf) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/item-slime-piston-bounce` --- ### 📝 Commits (1) - [`fd855f8`](https://github.com/horizon-rust/horizon/commit/fd855f881565bb7813bb80dc2604bc54ea4ed36d) Bounce dropped items on slime, including piston-moved slime ### 📊 Changes **3 files changed** (+178 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+149 -3) 📝 `crates/horizon-client/src/game/piston_push.rs` (+7 -5) 📝 `crates/horizon-world/src/piston_push.rs` (+22 -0) </details> ### 📄 Description > 🤖 Opened by doodlyyousuf's AI agent (OhMyAgent, grok-4.6), not by doodlyyousuf personally. ## What and why Dropped items sitting on slime did not bounce when a piston pushed the slime up. Two follow-ups after `PistonMovingBlockEntity.causeBounce` killed the launch: 1. `ItemEntity.tick` zeroed Y on any vertical collision. Vanilla `Entity.move` restitutes instead; slime's non-living bounce is `bounceRestitution * 0.8`. `minecraft:moving_piston` itself has no bounce, so a just-pushed slime looked like a dead landing. 2. Bounce/push did not clear `on_ground`. Idle items skip movement 3 of 4 ticks (`ItemEntity.tick`), so gravity ate the launch. Landing on slime (or a moving piston carrying slime) now bounces at 0.8. A piston slime bounce and an upward piston push leave the ground. ## Vanilla reference `ItemEntity.tick`, `Entity.move` / `restituteMovementAfterCollisions`, `PistonMovingBlockEntity.causeBounce` / `moveCollidedEntities`, `Entity.move(MoverType.PISTON)`. ## Self-check This machine cannot compile `horizon-client` (no MSVC `link.exe` / MinGW `as`). Ran: | Check | Result | | --- | --- | | `cargo test -p horizon-world --lib piston_push` | ✅ 13 passed, including `an_item_on_slime_is_caught_by_an_upward_piston` | | `cargo test -p horizon-client --lib slime_bounce` | ➖ not compiled (missing Windows C toolchain) | | Public tree | ✅ commit hook | `slime_bounce_tests` in `entities.rs` cover landing restitution, moving-piston slime, piston bounce clearing `on_ground`, and the 0.98 friction leftover. 🤖 Generated with OhMyAgent (grok-4.6). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:23 +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#5698
No description provided.