[PR #3747] [MERGED] Break effects: a block that pops off when its support is mined plays its sound and particles for the miner #5192

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3747
Author: @xFedeT
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/break-effects-for-popped-blocks


📝 Commits (7)

  • c11d57d Break effects: a block that pops off when its support is mined plays its break sound and particles for the miner
  • eed02f0 lan_e2e: popped_break_effects check for blocks that pop off a mined support
  • 582331c lan_e2e: popped_break_effects mines by hand in survival, torch on top
  • fea840e Merge origin/main into fix/break-effects-for-popped-blocks
  • 7835010 Merge main into fix/break-effects-for-popped-blocks (resolve tools/lan_e2e.py)
  • 0d5cd6a Merge main into fix/break-effects-for-popped-blocks (resolve tools/lan_e2e.py)
  • 972719f Merge main into fix/break-effects-for-popped-blocks (resolve tools/lan_e2e.py)

📊 Changes

3 files changed (+67 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+9 -1)
📝 crates/horizon-client/src/game/lan.rs (+11 -1)
📝 tools/lan_e2e.py (+47 -0)

📄 Description

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

Refs #3604 (point 4: "no sound or particle effects when a block breaks due to damage from below"). Checked: no open PR touches the destroy events of an acting player.

What and why

Mining the block a torch (or a flower, a stalk, ...) stands on made the torch pop off silently for the miner: no break sound, no break particles. In single player the window is a client of the server thread, so the miner is the "acting guest": lan_record_events sent every level event of the action with that player excluded. In vanilla Block.playerWillDestroy excludes the player only from the destroy events of the block it breaks (and its other half, Level.levelEvent(player, 2001, ...)); what the break sets off afterwards goes through Level.destroyBlock with no player, and the miner hears and sees it.

Change

  • game.rs: lan_break_pos, the block break_block is breaking, set around the break.
  • game/lan.rs lan_record_events: during a break, the 2001 events up to and including the one at the broken position keep the acting guest excluded (the other halves of doors, plants and beds come first, then the block itself); later 2001 events (pop-offs from the neighbour updates) go to everyone.

Vanilla reference

Block.playerWillDestroy, Level.destroyBlock, Block.updateOrDestroy, LevelEvent.PARTICLES_DESTROY_BLOCK (2001).

Testing

  • Verified with horizon-ctl: stone with a torch on top, break the stone. Before: heard block.stone.break only. After: block.stone.break and block.wood.break.
  • QA by Federico in game (survival, audio on): torch, flower, sugar cane, plain blocks, a door and a bed: the popped blocks make sound and particles, no doubled sound on the broken block itself.

pr_ready --quick: results follow in a comment. Parity harnesses are left to CI.

🤖 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/3747 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/break-effects-for-popped-blocks` --- ### 📝 Commits (7) - [`c11d57d`](https://github.com/horizon-rust/horizon/commit/c11d57d1f803208ac4ad44eda75e9c1144b3715e) Break effects: a block that pops off when its support is mined plays its break sound and particles for the miner - [`eed02f0`](https://github.com/horizon-rust/horizon/commit/eed02f0cdaad5e8516a8141eb817ec981dbf2db4) lan_e2e: popped_break_effects check for blocks that pop off a mined support - [`582331c`](https://github.com/horizon-rust/horizon/commit/582331c3ea6c15ae4a8efc382e26189566fc536b) lan_e2e: popped_break_effects mines by hand in survival, torch on top - [`fea840e`](https://github.com/horizon-rust/horizon/commit/fea840e0d47efaa7fcf867d15920f3b1792406c3) Merge origin/main into fix/break-effects-for-popped-blocks - [`7835010`](https://github.com/horizon-rust/horizon/commit/7835010339a93846341badce115846a6b119d14f) Merge main into fix/break-effects-for-popped-blocks (resolve tools/lan_e2e.py) - [`0d5cd6a`](https://github.com/horizon-rust/horizon/commit/0d5cd6a591564f85f175513a973c4c62dc8abe50) Merge main into fix/break-effects-for-popped-blocks (resolve tools/lan_e2e.py) - [`972719f`](https://github.com/horizon-rust/horizon/commit/972719f0888261991da7cf063b3f86265f1e3054) Merge main into fix/break-effects-for-popped-blocks (resolve tools/lan_e2e.py) ### 📊 Changes **3 files changed** (+67 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+9 -1) 📝 `crates/horizon-client/src/game/lan.rs` (+11 -1) 📝 `tools/lan_e2e.py` (+47 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Refs #3604 (point 4: "no sound or particle effects when a block breaks due to damage from below"). Checked: no open PR touches the destroy events of an acting player. ## What and why Mining the block a torch (or a flower, a stalk, ...) stands on made the torch pop off silently for the miner: no break sound, no break particles. In single player the window is a client of the server thread, so the miner is the "acting guest": `lan_record_events` sent every level event of the action with that player excluded. In vanilla `Block.playerWillDestroy` excludes the player only from the destroy events of the block it breaks (and its other half, `Level.levelEvent(player, 2001, ...)`); what the break sets off afterwards goes through `Level.destroyBlock` with no player, and the miner hears and sees it. ## Change - `game.rs`: `lan_break_pos`, the block `break_block` is breaking, set around the break. - `game/lan.rs` `lan_record_events`: during a break, the 2001 events up to and including the one at the broken position keep the acting guest excluded (the other halves of doors, plants and beds come first, then the block itself); later 2001 events (pop-offs from the neighbour updates) go to everyone. ## Vanilla reference `Block.playerWillDestroy`, `Level.destroyBlock`, `Block.updateOrDestroy`, `LevelEvent.PARTICLES_DESTROY_BLOCK` (2001). ## Testing - Verified with `horizon-ctl`: stone with a torch on top, `break` the stone. Before: heard `block.stone.break` only. After: `block.stone.break` and `block.wood.break`. - QA by Federico in game (survival, audio on): torch, flower, sugar cane, plain blocks, a door and a bed: the popped blocks make sound and particles, no doubled sound on the broken block itself. **pr_ready --quick**: results follow in a comment. Parity harnesses are left to CI. 🤖 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 05:10:51 +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#5192
No description provided.