[PR #6187] [CLOSED] A mob breaking a block shows its destroy particles to the player (sheep grazing) #6707

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6187
Author: @xFedeT
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: fix/sheep-graze-particles


📝 Commits (2)

  • d92b57e A mob breaking a block sends the destroy level event, so the window sees the particles
  • e91fb29 Queue a mob's block-break event instead of flushing every pending event

📊 Changes

1 file changed (+19 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+19 -13)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Fixes #6144

What was wrong

EatBlockGoal calls levelEvent(2001, below, Block.getId(grass)) for a grass block a sheep eats and destroyBlock for short grass; both reach every client as the destroy event (particles and the block's break sound). Horizon's MobEvent::SetBlockName { effect } and MobEvent::BreakBlock (game/creatures.rs) called destroy_particles (and, for the first, played the sound) on the Game that runs the mob, which is the server's: on single player's server thread, on a LAN or a dedicated server, the player's window never saw them.

What changes

Both queue level event 2001 with level_event_at(2001, pos, old state), the call other mob block changes already use: it plays the particles and the break sound here and is recorded for the served players. The break sound now follows LevelEventHandler (volume (volume + 1) / 2, pitch * 0.8) instead of the fixed 1.0 / 0.8 of the old code. Fire still shows no particles, as before.

Verification

Builds; clippy and rustfmt clean for the changed file except the existing needless_borrow in horizon-world; cargo test -p horizon-client --bins shows 551 passed and 2 failures in game::tnt (the soul sand and water current tests), which are in code this change does not touch. I did not watch a sheep graze; the event path is the one level_event_at callers elsewhere in the same file use.

Not done

Other destroy_particles callers on server-side code were not audited for the same gap.

🤖 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/6187 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/sheep-graze-particles` --- ### 📝 Commits (2) - [`d92b57e`](https://github.com/horizon-rust/horizon/commit/d92b57ecb3c3d438761b7473d4770db5c4388e78) A mob breaking a block sends the destroy level event, so the window sees the particles - [`e91fb29`](https://github.com/horizon-rust/horizon/commit/e91fb29326aaf497e3832ab4e2f805daca3ce4d5) Queue a mob's block-break event instead of flushing every pending event ### 📊 Changes **1 file changed** (+19 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+19 -13) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #6144 ## What was wrong `EatBlockGoal` calls `levelEvent(2001, below, Block.getId(grass))` for a grass block a sheep eats and `destroyBlock` for short grass; both reach every client as the destroy event (particles and the block's break sound). Horizon's `MobEvent::SetBlockName { effect }` and `MobEvent::BreakBlock` (`game/creatures.rs`) called `destroy_particles` (and, for the first, played the sound) on the Game that runs the mob, which is the server's: on single player's server thread, on a LAN or a dedicated server, the player's window never saw them. ## What changes Both queue level event 2001 with `level_event_at(2001, pos, old state)`, the call other mob block changes already use: it plays the particles and the break sound here and is recorded for the served players. The break sound now follows `LevelEventHandler` (volume `(volume + 1) / 2`, pitch `* 0.8`) instead of the fixed 1.0 / 0.8 of the old code. Fire still shows no particles, as before. ## Verification Builds; clippy and rustfmt clean for the changed file except the existing `needless_borrow` in `horizon-world`; `cargo test -p horizon-client --bins` shows 551 passed and 2 failures in `game::tnt` (the soul sand and water current tests), which are in code this change does not touch. I did not watch a sheep graze; the event path is the one `level_event_at` callers elsewhere in the same file use. ## Not done Other `destroy_particles` callers on server-side code were not audited for the same gap. 🤖 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 06:25: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#6707
No description provided.