[PR #7594] A wolf that dies mid-shake stops shaking #7701

Open
opened 2026-11-03 07:22:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7594
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/wolf-die-shake


📝 Commits (4)

  • eb1e04d fix: a wolf that dies mid-shake stops shaking
  • b904bbc test: a wolf that dies mid-shake is dry and still
  • db0baa0 port_map: Wolf.die is tame::die
  • 78f4131 test: prove the wolf reset runs on the death path

📊 Changes

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

View changed files

📝 crates/horizon-client/src/mobs/drops.rs (+9 -0)
📝 crates/horizon-client/src/mobs/tame.rs (+25 -0)
📝 tools/port_map/game2-001.tsv (+1 -1)

📄 Description

Vanilla

Wolf.die(DamageSource) (26.3) clears the wet and shake state before it hands over to TamableAnimal.die: isWet = false, isShaking = false, shakeAnimO = 0, shakeAnim = 0. A wolf killed while it is shaking the water off therefore stops shaking; the body does not keep the animation.

What Horizon got wrong

Horizon keeps that state in three places in mobs/tame.rs — extra.flag2 (wet), extra.counter2 (shaking) and anim.v/vo[SHAKE] — and nothing cleared them on death, so a wolf killed mid-shake was still wet and kept counting the shake up on its corpse. mobs/tame.rs::die is the missing reset, and mobs/drops.rs::die (the ported LivingEntity.die, which every mob death goes through) asks it before any loot is rolled. The ledger row tools/port_map/game2-001.tsv:34 said missing; it now points at the port.

Proven: javap -p -c -constants -cp /tmp/cj net.minecraft.world.entity.animal.wolf.Wolf → die(DamageSource): iconst_0 putfield isWet, iconst_0 putfield isShaking, fconst_0 putfield shakeAnimO, fconst_0 putfield shakeAnim, then invokespecial TamableAnimal.die. The new unit test soaks the wolf, starts the shake with entity event 8 and asserts all four are zero after the death.

Not proven: the build box is saturated by other lanes' runs, so cargo test had not finished when this was opened; CI will run it. No in-game kill was driven.


🔄 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/7594 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/wolf-die-shake` --- ### 📝 Commits (4) - [`eb1e04d`](https://github.com/horizon-rust/horizon/commit/eb1e04d086422653b386be22108d95f98200ff7c) fix: a wolf that dies mid-shake stops shaking - [`b904bbc`](https://github.com/horizon-rust/horizon/commit/b904bbccaa8f9952ffe963dc28fe40fac17eee94) test: a wolf that dies mid-shake is dry and still - [`db0baa0`](https://github.com/horizon-rust/horizon/commit/db0baa0a917cb8db1ff5993d4b187e83a2660577) port_map: Wolf.die is tame::die - [`78f4131`](https://github.com/horizon-rust/horizon/commit/78f41319e0af9b58fcd6a9884222d026d54a76c6) test: prove the wolf reset runs on the death path ### 📊 Changes **3 files changed** (+35 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/drops.rs` (+9 -0) 📝 `crates/horizon-client/src/mobs/tame.rs` (+25 -0) 📝 `tools/port_map/game2-001.tsv` (+1 -1) </details> ### 📄 Description ## Vanilla `Wolf.die(DamageSource)` (26.3) clears the wet and shake state before it hands over to `TamableAnimal.die`: `isWet = false`, `isShaking = false`, `shakeAnimO = 0`, `shakeAnim = 0`. A wolf killed while it is shaking the water off therefore stops shaking; the body does not keep the animation. ## What Horizon got wrong Horizon keeps that state in three places in `mobs/tame.rs` — `extra.flag2` (wet), `extra.counter2` (shaking) and `anim.v/vo[SHAKE]` — and nothing cleared them on death, so a wolf killed mid-shake was still wet and kept counting the shake up on its corpse. `mobs/tame.rs::die` is the missing reset, and `mobs/drops.rs::die` (the ported `LivingEntity.die`, which every mob death goes through) asks it before any loot is rolled. The ledger row `tools/port_map/game2-001.tsv:34` said `missing`; it now points at the port. **Proven:** `javap -p -c -constants -cp /tmp/cj net.minecraft.world.entity.animal.wolf.Wolf` → `die(DamageSource)`: `iconst_0 putfield isWet`, `iconst_0 putfield isShaking`, `fconst_0 putfield shakeAnimO`, `fconst_0 putfield shakeAnim`, then `invokespecial TamableAnimal.die`. The new unit test soaks the wolf, starts the shake with entity event 8 and asserts all four are zero after the death. **Not proven:** the build box is saturated by other lanes' runs, so `cargo test` had not finished when this was opened; CI will run it. No in-game kill was driven. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7701
No description provided.