[PR #5700] [MERGED] Name the TNT igniter in the blast's death message #6446

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

📋 Pull Request Information

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

Base: main ← Head: fix/4689-tnt-igniter


📝 Commits (1)

  • 0eb8fc5 name the TNT igniter in the blast's death message

📊 Changes

10 files changed (+109 additions, -19 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -1)
📝 crates/horizon-client/src/game/combat.rs (+6 -0)
📝 crates/horizon-client/src/game/creatures.rs (+1 -1)
📝 crates/horizon-client/src/game/dispenser.rs (+2 -2)
📝 crates/horizon-client/src/game/explosion.rs (+25 -8)
📝 crates/horizon-client/src/game/lan_pvp.rs (+1 -1)
📝 crates/horizon-client/src/game/persist.rs (+2 -0)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+2 -0)
📝 crates/horizon-client/src/game/tnt.rs (+42 -5)
📝 tools/lan_e2e.py (+27 -1)

📄 Description

🤖 Opened by calclb's AI agent (T3 Code, deepseek-v4.1-flash), not by calclb personally.

What and why

A player who dies to primed TNT another player lit sees death.attack.explosion
("blew up") instead of vanilla's death.attack.explosion.player ("was blown up by
"). Fixes #4689.

Explosion.getIndirectSourceEntity returns PrimedTnt.getOwner, and with both the
direct entity and the cause set, DamageSources.explosion(entity, cause) picks
minecraft:player_explosion (explosion.player).

  • PrimedTnt carries the igniter (Option<Who> plus the LAN guest) for the ignition
    paths that have one: flint and steel / fire charge, and TNT primed by the owner's own
    blast (TntBlock.wasExploded hands the new TNT the blast's indirect source, so a
    chain reaction keeps the player who started it). Dispenser, level-event and remote
    spawns stay ownerless, as in vanilla.
  • blast_attacker prefers that owner, so server_explode derives
    minecraft:player_explosion and the existing note_named_attacker path names the
    igniter. Both fields are reset after the blast, before the result is returned.

Not covered

  • A mob-caused chain blast keeps its existing credit path; the owner is carried for
    players only.
  • The other gaps listed in the issue (custom-named weapon messages, the mace/spear verb,
    a thrown trident against a player) are untouched.

Test

python3 tools/lan_e2e.py --check deaths → [lan] deaths: PASS.

The added TNT step lights TNT next to the guest with flint and steel and asserts
Guest was blown up by <host>; it also asserts no raw %1$s/%2$s template leaks and
that the blast kills the pig.

Vanilla reference: TntBlock.java:73 (new PrimedTnt(…, explosion.getIndirectSourceEntity())),
:91 (the igniting entity), Explosion.getIndirectSourceEntity,
DamageSources.explosion.

🤖 Generated with T3 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/5700 **Author:** [@calclb](https://github.com/calclb) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/4689-tnt-igniter` --- ### 📝 Commits (1) - [`0eb8fc5`](https://github.com/horizon-rust/horizon/commit/0eb8fc511b823634ed16f253d5c26c9437961aba) name the TNT igniter in the blast's death message ### 📊 Changes **10 files changed** (+109 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -1) 📝 `crates/horizon-client/src/game/combat.rs` (+6 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -1) 📝 `crates/horizon-client/src/game/dispenser.rs` (+2 -2) 📝 `crates/horizon-client/src/game/explosion.rs` (+25 -8) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+1 -1) 📝 `crates/horizon-client/src/game/persist.rs` (+2 -0) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+2 -0) 📝 `crates/horizon-client/src/game/tnt.rs` (+42 -5) 📝 `tools/lan_e2e.py` (+27 -1) </details> ### 📄 Description > 🤖 Opened by calclb's AI agent (T3 Code, deepseek-v4.1-flash), not by calclb personally. ## What and why A player who dies to primed TNT another player lit sees `death.attack.explosion` ("blew up") instead of vanilla's `death.attack.explosion.player` ("was blown up by <igniter>"). Fixes #4689. `Explosion.getIndirectSourceEntity` returns `PrimedTnt.getOwner`, and with both the direct entity and the cause set, `DamageSources.explosion(entity, cause)` picks `minecraft:player_explosion` (`explosion.player`). - `PrimedTnt` carries the igniter (`Option<Who>` plus the LAN guest) for the ignition paths that have one: flint and steel / fire charge, and TNT primed by the owner's own blast (`TntBlock.wasExploded` hands the new TNT the blast's indirect source, so a chain reaction keeps the player who started it). Dispenser, level-event and remote spawns stay ownerless, as in vanilla. - `blast_attacker` prefers that owner, so `server_explode` derives `minecraft:player_explosion` and the existing `note_named_attacker` path names the igniter. Both fields are reset after the blast, before the result is returned. ## Not covered - A mob-caused chain blast keeps its existing credit path; the owner is carried for players only. - The other gaps listed in the issue (custom-named weapon messages, the mace/spear verb, a thrown trident against a player) are untouched. ## Test `python3 tools/lan_e2e.py --check deaths` → `[lan] deaths: PASS`. The added TNT step lights TNT next to the guest with flint and steel and asserts `Guest was blown up by <host>`; it also asserts no raw `%1$s`/`%2$s` template leaks and that the blast kills the pig. Vanilla reference: `TntBlock.java:73` (`new PrimedTnt(…, explosion.getIndirectSourceEntity())`), `:91` (the igniting entity), `Explosion.getIndirectSourceEntity`, `DamageSources.explosion`. 🤖 Generated with T3 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:20:44 +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#6446
No description provided.