[PR #7122] [MERGED] A moving piston with no block entity is removed by a click #7355

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

📋 Pull Request Information

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

Base: main ← Head: fix/piston-orphan-use


📝 Commits (2)

  • d9e5bc1 A moving piston with no block entity is removed by a click
  • c928a17 Moving piston click: CONSUME, not SUCCESS

📊 Changes

2 files changed (+49 additions, -0 deletions)

View changed files

📝 crates/horizon-world/src/level/interact.rs (+12 -0)
📝 crates/horizon-world/src/level/tests.rs (+37 -0)

📄 Description

Vanilla 26.3's MovingPistonBlock.useWithoutItem removes a minecraft:moving_piston block whose block entity is gone (the move is over) when a player right-clicks it, with Level.removeBlock(pos, false), and passes the click on while the move is still in flight.

Horizon had no MovingPiston arm in Sim::use_without_item at all, so such a block stayed for good, even though tools/port_map/game2-018.tsv already pointed that method at this function.

Proven:

  • cargo test -q -p horizon-world --lib moving_piston -> 2 passed; 0 failed; 0 ignored; 310 filtered out: the new a_moving_piston_without_a_block_entity_is_removed_by_a_click (the orphan block becomes air and the click is Success; a moving piston still in flight keeps its block and the click is Pass) next to the existing drops test.
  • The same test with the arm removed (git checkout upstream/main -- crates/horizon-world/src/level/interact.rs, same worktree) -> FAILED. 0 passed; 1 failed, assertion left == right failed: left: Pass, right: Success at the first assertion, so the case pins the behaviour.
  • cargo clippy -q -p horizon-world --lib clean, rustfmt --edition 2024 --check clean on both files.

Not proven: nothing was watched in a real client. A moving_piston block with no block entity only comes from a save taken mid-move; the in-game check is to load such a world and right-click that block, which should remove it.


🔄 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/7122 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/piston-orphan-use` --- ### 📝 Commits (2) - [`d9e5bc1`](https://github.com/horizon-rust/horizon/commit/d9e5bc1bc85a77d635c15a6edb2c71a728bdd41a) A moving piston with no block entity is removed by a click - [`c928a17`](https://github.com/horizon-rust/horizon/commit/c928a178028c00bb07ca4422d8dc9a436d9ad3f1) Moving piston click: CONSUME, not SUCCESS ### 📊 Changes **2 files changed** (+49 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/level/interact.rs` (+12 -0) 📝 `crates/horizon-world/src/level/tests.rs` (+37 -0) </details> ### 📄 Description Vanilla 26.3's `MovingPistonBlock.useWithoutItem` removes a `minecraft:moving_piston` block whose block entity is gone (the move is over) when a player right-clicks it, with `Level.removeBlock(pos, false)`, and passes the click on while the move is still in flight. Horizon had no `MovingPiston` arm in `Sim::use_without_item` at all, so such a block stayed for good, even though `tools/port_map/game2-018.tsv` already pointed that method at this function. **Proven:** - `cargo test -q -p horizon-world --lib moving_piston` -> `2 passed; 0 failed; 0 ignored; 310 filtered out`: the new `a_moving_piston_without_a_block_entity_is_removed_by_a_click` (the orphan block becomes air and the click is `Success`; a moving piston still in flight keeps its block and the click is `Pass`) next to the existing drops test. - The same test with the arm removed (`git checkout upstream/main -- crates/horizon-world/src/level/interact.rs`, same worktree) -> `FAILED. 0 passed; 1 failed`, `assertion left == right failed: left: Pass, right: Success` at the first assertion, so the case pins the behaviour. - `cargo clippy -q -p horizon-world --lib` clean, `rustfmt --edition 2024 --check` clean on both files. **Not proven:** nothing was watched in a real client. A `moving_piston` block with no block entity only comes from a save taken mid-move; the in-game check is to load such a world and right-click that block, which should remove it. --- <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:12 +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#7355
No description provided.