[PR #7021] [MERGED] A wolf's cracking armor sends its scute particles #7277

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

📋 Pull Request Information

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

Base: main ← Head: fix/6978-wolf-armor-particles


📝 Commits (4)

  • b0d11e0 A wolf's cracking armor sends its scute particles
  • 8c2f6cb Test the scute particles of a cracking wolf armor
  • 147f32f Merge origin/main
  • 14189dc Merge origin/main

📊 Changes

3 files changed (+80 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+13 -0)
📝 crates/horizon-client/src/mobs.rs (+17 -0)
📝 crates/horizon-client/src/mobs/item_break.rs (+50 -0)

📄 Description

🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review.

Fixes #6978

What was wrong

Wolf.actuallyHurt wears the body armor and, when its Crackiness.WOLF_ARMOR level changes, plays wolf_armor_crack and then sends ServerLevel.sendParticles of an ItemParticleOption(ITEM, armadillo_scute) at the wolf's x, y + 1.0 and z: 20 particles, spread 0.2 / 0.1 / 0.2, speed 0.1 (read with javap on the 26.3 server jar). Mob::hurt_wolf_armor pushed only the crack sound.

What changed

  • mobs.rs: a MobEvent::ItemParticles { item, at, spread, speed, count }, and hurt_wolf_armor pushes it beside the crack sound with the values above.
  • game/creatures.rs: handle_mob_events draws it with Game::item_particle and send_particles.

It is drawn in the host's own window only: hub_particle has no item for the LAN packet yet (ITEM returns none there), as for the other item particles. Teaching that packet the item is a separate change.

Two commits, the fix and its test.

How it was checked

Unit test a_wolfs_armor_throws_scutes_as_it_cracks: three points of wear are still the first level (no sound, no particles), the fourth cracks it (the sound and the 20 scutes at x, y + 1, z with that spread and speed), ten more stay within the level, six more reach the 69% level and crack it again.

In the game (horizon-ctl launch --offscreen, creative world), an armored wolf (equipment:{body:wolf_armor}, NoAI) hit with a diamond sword every 1.5 s. horizon-ctl status has no counter for item particles, so I read the particle engine's own count of the item particles made, through a temporary print that is not in this branch:

Hit Armor wear Scutes made
1 7 (first level) 20
2 14 0
3 21 (69% level) 20
4 to 6 28, 35, 42 0

Self-check

tools/pr_ready.py --quick --base origin/main:

Check Result
Scope 3 files, +80 −0
Cargo.lock unchanged
rustfmt, clippy ✅
tests: horizon-client, horizon-client-lib ✅ 2059 passed
mod API up to date ✅
Python tests 4 errors from my machine's setup (a global tests package, no launcher build), untouched here
Parity not run (--quick): the CI parity job picks the affected harnesses

Label: a fix, no feature label.


🔄 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/7021 **Author:** [@Akirabane](https://github.com/Akirabane) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6978-wolf-armor-particles` --- ### 📝 Commits (4) - [`b0d11e0`](https://github.com/horizon-rust/horizon/commit/b0d11e07ca078129bb4914f1be9ceb12f9c38d08) A wolf's cracking armor sends its scute particles - [`8c2f6cb`](https://github.com/horizon-rust/horizon/commit/8c2f6cbefec5524311cd31b58beabf223ea8cb25) Test the scute particles of a cracking wolf armor - [`147f32f`](https://github.com/horizon-rust/horizon/commit/147f32f1a521a0f3cbcf1e7f6c0cd14ea1c62638) Merge origin/main - [`14189dc`](https://github.com/horizon-rust/horizon/commit/14189dc867c1edc8a5b4b37295464dcf07295ba0) Merge origin/main ### 📊 Changes **3 files changed** (+80 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+13 -0) 📝 `crates/horizon-client/src/mobs.rs` (+17 -0) 📝 `crates/horizon-client/src/mobs/item_break.rs` (+50 -0) </details> ### 📄 Description > 🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review. Fixes #6978 ## What was wrong `Wolf.actuallyHurt` wears the body armor and, when its `Crackiness.WOLF_ARMOR` level changes, plays `wolf_armor_crack` and then sends `ServerLevel.sendParticles` of an `ItemParticleOption(ITEM, armadillo_scute)` at the wolf's x, y + 1.0 and z: 20 particles, spread 0.2 / 0.1 / 0.2, speed 0.1 (read with `javap` on the 26.3 server jar). `Mob::hurt_wolf_armor` pushed only the crack sound. ## What changed - `mobs.rs`: a `MobEvent::ItemParticles { item, at, spread, speed, count }`, and `hurt_wolf_armor` pushes it beside the crack sound with the values above. - `game/creatures.rs`: `handle_mob_events` draws it with `Game::item_particle` and `send_particles`. It is drawn in the host's own window only: `hub_particle` has no item for the LAN packet yet (`ITEM` returns none there), as for the other item particles. Teaching that packet the item is a separate change. Two commits, the fix and its test. ## How it was checked Unit test `a_wolfs_armor_throws_scutes_as_it_cracks`: three points of wear are still the first level (no sound, no particles), the fourth cracks it (the sound and the 20 scutes at x, y + 1, z with that spread and speed), ten more stay within the level, six more reach the 69% level and crack it again. In the game (`horizon-ctl launch --offscreen`, creative world), an armored wolf (`equipment:{body:wolf_armor}`, `NoAI`) hit with a diamond sword every 1.5 s. `horizon-ctl status` has no counter for item particles, so I read the particle engine's own count of the `item` particles made, through a temporary print that is not in this branch: | Hit | Armor wear | Scutes made | | --- | --- | --- | | 1 | 7 (first level) | 20 | | 2 | 14 | 0 | | 3 | 21 (69% level) | 20 | | 4 to 6 | 28, 35, 42 | 0 | ## Self-check `tools/pr_ready.py --quick --base origin/main`: | Check | Result | | --- | --- | | Scope | 3 files, +80 −0 | | Cargo.lock | unchanged | | rustfmt, clippy | ✅ | | tests: horizon-client, horizon-client-lib | ✅ 2059 passed | | mod API up to date | ✅ | | Python tests | 4 errors from my machine's setup (a global `tests` package, no launcher build), untouched here | | Parity | not run (`--quick`): the CI parity job picks the affected harnesses | Label: a fix, no `feature` label. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:36:57 +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#7277
No description provided.