[PR #6252] [MERGED] Cap a dangerous wither skull's blast at 0.8 resistance #6743

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6252
Author: @MSedgeMC
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/wither-skull-resistance


📝 Commits (2)

  • e915bbc Cap a dangerous wither skull's blast at 0.8 resistance
  • ea514b4 Merge remote-tracking branch 'origin/main' into fix-6252

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/combat.rs (+3 -0)
📝 crates/horizon-client/src/game/explosion.rs (+35 -2)
📝 crates/horizon-client/src/game/wither.rs (+9 -0)

📄 Description

WitherSkull.getBlockExplosionResistance overrides the default calculator for a dangerous
(blue) skull:

// javap -p -c on WitherSkull
 1: invokevirtual isDangerous
 4: ifeq          23
 9: invokestatic  WitherBoss.canDestroy:(BlockState)Z
12: ifeq          23
15: ldc           0.8f
17: fload 6                    // the block's own resistance
19: invokestatic  Math.min:(FF)F
23: fload 6 ... freturn

with WitherBoss.canDestroy(state) = !state.isAir() && !state.is(#wither_immune).

Horizon's ray march always used block.explosion_resistance.max(fluid), so a blue skull's
blast was stopped by the same blocks as TNT: blast-resistant blocks survived that vanilla
destroys, and the blast did not reach as far.

Proven: on the build VM, cargo test -q -p horizon-client --bin horizon-client a_dangerous_wither_skull_caps_block_resistance
→ 1 passed: 4.0 with the cap becomes 0.8, a lower resistance is untouched, a
#wither_immune block keeps 4.0, and a blast with no cap keeps 4.0.

Not proven: the ray march itself is not covered by a test (it needs a running level); the
wiring is compile-checked. The in-game check: fire a blue skull at a block with resistance
above 0.8, such as an enchanting table or an anvil, and see it destroyed.

One deliberate limit: the cap is carried on the blast as a single value and cleared right after
the skull's explode, so a nested explosion started from inside that one would inherit it.
Nothing in the game starts an explosion from a blast callback.


🔄 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/6252 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/wither-skull-resistance` --- ### 📝 Commits (2) - [`e915bbc`](https://github.com/horizon-rust/horizon/commit/e915bbc0ec3f1b1fef1fa8b6b9fd9ab5114e3762) Cap a dangerous wither skull's blast at 0.8 resistance - [`ea514b4`](https://github.com/horizon-rust/horizon/commit/ea514b4c6b4af767c0bbe90e16dd9e29ee0d4223) Merge remote-tracking branch 'origin/main' into fix-6252 ### 📊 Changes **3 files changed** (+47 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/combat.rs` (+3 -0) 📝 `crates/horizon-client/src/game/explosion.rs` (+35 -2) 📝 `crates/horizon-client/src/game/wither.rs` (+9 -0) </details> ### 📄 Description `WitherSkull.getBlockExplosionResistance` overrides the default calculator for a dangerous (blue) skull: ```java // javap -p -c on WitherSkull 1: invokevirtual isDangerous 4: ifeq 23 9: invokestatic WitherBoss.canDestroy:(BlockState)Z 12: ifeq 23 15: ldc 0.8f 17: fload 6 // the block's own resistance 19: invokestatic Math.min:(FF)F 23: fload 6 ... freturn ``` with `WitherBoss.canDestroy(state)` = `!state.isAir() && !state.is(#wither_immune)`. Horizon's ray march always used `block.explosion_resistance.max(fluid)`, so a blue skull's blast was stopped by the same blocks as TNT: blast-resistant blocks survived that vanilla destroys, and the blast did not reach as far. **Proven:** on the build VM, `cargo test -q -p horizon-client --bin horizon-client a_dangerous_wither_skull_caps_block_resistance` → `1 passed`: 4.0 with the cap becomes 0.8, a lower resistance is untouched, a `#wither_immune` block keeps 4.0, and a blast with no cap keeps 4.0. **Not proven:** the ray march itself is not covered by a test (it needs a running level); the wiring is compile-checked. The in-game check: fire a blue skull at a block with resistance above 0.8, such as an enchanting table or an anvil, and see it destroyed. One deliberate limit: the cap is carried on the blast as a single value and cleared right after the skull's `explode`, so a nested explosion started from inside that one would inherit it. Nothing in the game starts an explosion from a blast callback. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:01 +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#6743
No description provided.