[PR #7142] [MERGED] Breaking a moving piston removes its extended base #7370

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

📋 Pull Request Information

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

Base: main ← Head: fix/piston-destroy


📝 Commits (4)

  • 5b2970e Breaking a moving piston removes its extended base
  • bbd7288 Merge upstream/main into the moving-piston base fix
  • b7f47ba Restore the moving-piston use test's tail after the merge
  • 6ce9197 Merge remote-tracking branch 'upstream/main' into fix/piston-destroy

📊 Changes

3 files changed (+50 additions, -1 deletions)

View changed files

📝 crates/horizon-world/src/level/tests.rs (+30 -0)
📝 crates/horizon-world/src/level/update.rs (+19 -0)
📝 tools/port_map/game2-018.tsv (+1 -1)

📄 Description

Vanilla 26.3's MovingPistonBlock.destroy removes the piston base behind a minecraft:moving_piston block when that block goes away, if the base is a PistonBaseBlock with extended=true, so breaking a head that is still moving never leaves an extended base standing.

Horizon removed the moving piston's own entity when its block was replaced but never touched the base, so breaking a moving piston left the extended base piston beside it.

Proven:

  • cargo test -q -p horizon-world --lib breaking_a_moving_piston -> 1 passed; 0 failed; 0 ignored; 311 filtered out: the new breaking_a_moving_piston_removes_its_extended_base breaks a head whose base is extended (the base becomes air) and then one whose base is unextended (the base stays).
  • The same test with the hook removed (git checkout upstream/main -- crates/horizon-world/src/level/update.rs, same worktree) -> FAILED. 0 passed; 1 failed, assertion left == right failed: the extended base goes with the moving piston, left: BlockStateId(2374), right: BlockStateId(0), so the case pins the behaviour.
  • cargo clippy -q -p horizon-world --lib clean, rustfmt --edition 2024 --check clean on both files.
  • tools/port_map/game2-018.tsv: the MovingPistonBlock.destroy row now names crates/horizon-world/src/level/update.rs::Sim::destroy_moving_piston_base.

Not proven: nothing was watched in a real client. The in-game check is to break a piston head while the piston is still moving (a fast redstone clock on the piston) and see the base go with it instead of staying extended.


🔄 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/7142 **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-destroy` --- ### 📝 Commits (4) - [`5b2970e`](https://github.com/horizon-rust/horizon/commit/5b2970e45d4982c6a028ae2f698bd1ffa6d8e6e2) Breaking a moving piston removes its extended base - [`bbd7288`](https://github.com/horizon-rust/horizon/commit/bbd7288daca72bb0f744fc4d876af69ea58c8276) Merge upstream/main into the moving-piston base fix - [`b7f47ba`](https://github.com/horizon-rust/horizon/commit/b7f47bab1dfb1648dde848347c11a588bec03ee5) Restore the moving-piston use test's tail after the merge - [`6ce9197`](https://github.com/horizon-rust/horizon/commit/6ce919736a600add00ff9cf010db2339975dff55) Merge remote-tracking branch 'upstream/main' into fix/piston-destroy ### 📊 Changes **3 files changed** (+50 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/level/tests.rs` (+30 -0) 📝 `crates/horizon-world/src/level/update.rs` (+19 -0) 📝 `tools/port_map/game2-018.tsv` (+1 -1) </details> ### 📄 Description Vanilla 26.3's `MovingPistonBlock.destroy` removes the piston base behind a `minecraft:moving_piston` block when that block goes away, if the base is a `PistonBaseBlock` with `extended=true`, so breaking a head that is still moving never leaves an extended base standing. Horizon removed the moving piston's own entity when its block was replaced but never touched the base, so breaking a moving piston left the extended base piston beside it. **Proven:** - `cargo test -q -p horizon-world --lib breaking_a_moving_piston` -> `1 passed; 0 failed; 0 ignored; 311 filtered out`: the new `breaking_a_moving_piston_removes_its_extended_base` breaks a head whose base is extended (the base becomes air) and then one whose base is unextended (the base stays). - The same test with the hook removed (`git checkout upstream/main -- crates/horizon-world/src/level/update.rs`, same worktree) -> `FAILED. 0 passed; 1 failed`, `assertion left == right failed: the extended base goes with the moving piston, left: BlockStateId(2374), right: BlockStateId(0)`, so the case pins the behaviour. - `cargo clippy -q -p horizon-world --lib` clean, `rustfmt --edition 2024 --check` clean on both files. - `tools/port_map/game2-018.tsv`: the `MovingPistonBlock.destroy` row now names `crates/horizon-world/src/level/update.rs::Sim::destroy_moving_piston_base`. **Not proven:** nothing was watched in a real client. The in-game check is to break a piston head while the piston is still moving (a fast redstone clock on the piston) and see the base go with it instead of staying extended. --- <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:28 +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#7370
No description provided.