[PR #4934] [MERGED] fix(explosion): mobs are pushed even when the hit is refused #5953

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4934
Author: @reservedbytes
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/explosion-pushes-refused-mobs


📝 Commits (1)

  • 0b83386 fix(explosion): mobs are pushed even when the hit is refused

📊 Changes

1 file changed (+130 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/game/explosion.rs (+130 -14)

📄 Description

What and why

An explosion skipped a mob's push whenever the mob refused the hit: an invulnerable mob, one in its hurt cooldown, a wither hit by an undead cause
Vanilla pushes every entity in reach whatever hurtServer returned, so those mobs are now pushed like the others
Players were already pushed either way
A pushed mob is now also sent to clients at once, as vanilla's push does, instead of waiting for its next regular update

The one mob vanilla leaves out entirely is a digging or emerging warden (Warden.ignoreExplosion), which is neither hurt nor pushed
Before, it was left out only when its hit was refused, so a team mate of the exploding mob was still pushed
It is now left out on its own check

A unit test covers an ordinary mob, which is hurt and pushed, and an invulnerable mob, a team mate of the exploding mob and a wither in an undead's blast, which are pushed but not hurt

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

ServerExplosion.hurtEntities (world/level/ServerExplosion.java:171-211) skips an entity only when ignoreExplosion is true (:182) or it is out of reach (:184)
It calls hurtServer (:191) and then pushFromExplosion (:199) without looking at what hurtServer returned
Entity.push adds the velocity and sets needsSync (world/entity/Entity.java:1964-1969)
Warden.ignoreExplosion is true while it digs or emerges (world/entity/monster/warden/Warden.java:371-373)

Self-check

Check Result
Scope ✅ 1 files, +130 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 484 passed (53 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 54 s)
tests: horizon-client ✅ 1271 passed (3 min 41 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/4934 **Author:** [@reservedbytes](https://github.com/reservedbytes) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/explosion-pushes-refused-mobs` --- ### 📝 Commits (1) - [`0b83386`](https://github.com/horizon-rust/horizon/commit/0b83386c7e544994fabe456e4217436ed5a660da) fix(explosion): mobs are pushed even when the hit is refused ### 📊 Changes **1 file changed** (+130 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/explosion.rs` (+130 -14) </details> ### 📄 Description ## What and why An explosion skipped a mob's push whenever the mob refused the hit: an invulnerable mob, one in its hurt cooldown, a wither hit by an undead cause Vanilla pushes every entity in reach whatever `hurtServer` returned, so those mobs are now pushed like the others Players were already pushed either way A pushed mob is now also sent to clients at once, as vanilla's push does, instead of waiting for its next regular update The one mob vanilla leaves out entirely is a digging or emerging warden (`Warden.ignoreExplosion`), which is neither hurt nor pushed Before, it was left out only when its hit was refused, so a team mate of the exploding mob was still pushed It is now left out on its own check A unit test covers an ordinary mob, which is hurt and pushed, and an invulnerable mob, a team mate of the exploding mob and a wither in an undead's blast, which are pushed but not hurt ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `ServerExplosion.hurtEntities` (`world/level/ServerExplosion.java:171-211`) skips an entity only when `ignoreExplosion` is true (`:182`) or it is out of reach (`:184`) It calls `hurtServer` (`:191`) and then `pushFromExplosion` (`:199`) without looking at what `hurtServer` returned `Entity.push` adds the velocity and sets `needsSync` (`world/entity/Entity.java:1964-1969`) `Warden.ignoreExplosion` is true while it digs or emerges (`world/entity/monster/warden/Warden.java:371-373`) ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 1 files, +130 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 484 passed (53 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 54 s) | | tests: horizon-client | ✅ 1271 passed (3 min 41 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:10 +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#5953
No description provided.