[PR #6917] [CLOSED] tnt: read and apply explosion_power for primed TNT (fixes #6889) #7192

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6917
Author: @glitchsnake
Created: 11/2/2026
Status: ❌ Closed

Base: main ← Head: fix/6889-tnt-explosion-power


📝 Commits (1)

  • ce3b72b tnt: read and apply explosion_power for primed TNT (fixes #6889)

📊 Changes

7 files changed (+90 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+56 -1)
📝 crates/horizon-client/src/game/commands/data.rs (+1 -0)
📝 crates/horizon-client/src/game/nether_portal.rs (+1 -0)
📝 crates/horizon-client/src/game/persist.rs (+3 -0)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+1 -0)
📝 crates/horizon-client/src/game/tnt.rs (+26 -1)
📝 tools/port_map/game2-002.tsv (+2 -2)

📄 Description

🤖 Opened by glitchsnake's AI agent (Antigravity), not by glitchsnake personally.

Fixes #6889.

What and why

In Java Edition 26.3 PrimedTnt reads explosion_power from NBT (clamped between 0.0 and 128.0, default 4.0) and uses it as the explosion radius in tick. Previously, Game::tick_tnt hardcoded 4.0, ignoring custom power values from summoned or modded TNT.

This change:

  • Adds pub explosion_power: f32 to PrimedTnt with default 4.0.
  • Reads explosion_power in persist.rs via entity_nbt::tnt_explosion_power with clamping to 0.0..=128.0.
  • Serializes explosion_power in entity_nbt::tnt_to_nbt.
  • Passes t.explosion_power to server_explode in Game::tick_tnt.
  • Updates tools/port_map/game2-002.tsv gap notes.
  • Adds unit tests verifying serialization, deserialization, clamping, and default behavior.

Verification

  • pr_ready.py --quick: public tree check, rustfmt, clippy, doc tests, and 2024 tests in horizon-client and horizon-client-lib all passed.
  • Unit test entity_nbt::mod_thrown_nbt_tests::tnt_nbt_serializes_and_parses_explosion_power passed.

🤖 Generated with Antigravity


🔄 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/6917 **Author:** [@glitchsnake](https://github.com/glitchsnake) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/6889-tnt-explosion-power` --- ### 📝 Commits (1) - [`ce3b72b`](https://github.com/horizon-rust/horizon/commit/ce3b72bc42832c6f79cebfb64a75b7c7f9758d17) tnt: read and apply explosion_power for primed TNT (fixes #6889) ### 📊 Changes **7 files changed** (+90 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+56 -1) 📝 `crates/horizon-client/src/game/commands/data.rs` (+1 -0) 📝 `crates/horizon-client/src/game/nether_portal.rs` (+1 -0) 📝 `crates/horizon-client/src/game/persist.rs` (+3 -0) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+1 -0) 📝 `crates/horizon-client/src/game/tnt.rs` (+26 -1) 📝 `tools/port_map/game2-002.tsv` (+2 -2) </details> ### 📄 Description > 🤖 Opened by glitchsnake's AI agent (Antigravity), not by glitchsnake personally. Fixes #6889. ## What and why In Java Edition 26.3 `PrimedTnt` reads `explosion_power` from NBT (clamped between 0.0 and 128.0, default 4.0) and uses it as the explosion radius in `tick`. Previously, `Game::tick_tnt` hardcoded `4.0`, ignoring custom power values from summoned or modded TNT. This change: - Adds `pub explosion_power: f32` to `PrimedTnt` with default `4.0`. - Reads `explosion_power` in `persist.rs` via `entity_nbt::tnt_explosion_power` with clamping to `0.0..=128.0`. - Serializes `explosion_power` in `entity_nbt::tnt_to_nbt`. - Passes `t.explosion_power` to `server_explode` in `Game::tick_tnt`. - Updates `tools/port_map/game2-002.tsv` gap notes. - Adds unit tests verifying serialization, deserialization, clamping, and default behavior. ## Verification - `pr_ready.py --quick`: public tree check, rustfmt, clippy, doc tests, and 2024 tests in `horizon-client` and `horizon-client-lib` all passed. - Unit test `entity_nbt::mod_thrown_nbt_tests::tnt_nbt_serializes_and_parses_explosion_power` passed. 🤖 Generated with [Antigravity](https://antigravity.google.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:35:30 +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#7192
No description provided.