[PR #6728] [MERGED] A falling TNT minecart's blast grows with the fall #7059

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6728
Author: @HrafnaValkyrja
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/tnt-minecarts


📝 Commits (5)

  • ce2acb2 TNT minecart landing: blast grows with the fall, in the landing tick
  • fb6af5b Merge remote-tracking branch 'origin/main' into fix/tnt-minecarts
  • f602ae7 Merge remote-tracking branch 'origin/main' into fix/tnt-minecarts
  • 9f8a5e1 Merge remote-tracking branch 'origin/main' into fix/tnt-minecarts
  • a8ec405 Regenerate the mod API output after the merge with main

📊 Changes

2 files changed (+25 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/game/minecarts.rs (+23 -8)
📝 crates/horizon-client/src/mod_api/generated.rs (+2 -1)

📄 Description

🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself.

What and why

A TNT minecart that lands from a fall of three blocks or more blew up with a fixed blast of power 4 (and one tick late), however far it fell. In vanilla the blast grows with the fall: power is 4 + a random 0 to 1.5 times the fall distance divided by 10 (up to 5). The landing also counted only the fall before the last move, so a cart that fell just over three blocks did not blow up at all.

Changed: crates/horizon-client/src/game/minecarts.rs. The landing now counts the whole fall (not in water), and the cart blows up in the same tick with the vanilla speed (fall / 10) squared.

Fixes #6727

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

MinecartTNT.causeFallDamage (fall >= 3: explode(ignitionSource, (fall/10)^2)), MinecartTNT.explode (power = 4.0 + 1.0 * random * 1.5 * min(speed, 5)), Entity.checkFallDamage (the move's drop is added before the landing is handled; not in water).

Numbers

Side-by-side scene, TNT minecart dropped 40 blocks onto bedrock, pig with 1000 HP 6 blocks away, 24 drops each, damage to the pig:

mean min max
vanilla 42.1 12.0 76.6
Horizon after 42.9 16.4 82.7
Horizon before (6 drops) 9.75 every time

Pigs 9 and 12 blocks away were untouched before (6 of 6 drops); vanilla hurt them in 6 of 6. The cart disappeared on the same tick in vanilla and Horizon (tick 69). The blast power is random, so only the spread is comparable, not single drops.

Not covered

  • Activator-rail fuse (80 ticks), a set fuse, and lit-arrow hits on one cart matched vanilla already.
  • Landing on hay, slime or bed blocks (vanilla scales the fall) is not compared.

Part of #6431: this fixes the falling case only. #6134 is a different cause.

Proved by script against the real 26.3 server; no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at e6f5a1ae7, 12 min 24 s)

Check Result
Scope ✅ 2 files, +25 −9
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 602 passed (34 s)
rustfmt ✅ (9 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅ (2 min 56 s)
tests: horizon-client, horizon-client-lib ✅ 1962 passed (8 min 25 s)
doc tests ✅ 0 passed (7 s)
content root tests ➖ content root untouched
mod API up to date ✅ (7 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 236 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_removal, boat_authority, boat_paddle_reset, boat_submerged, command_exec, composter, crafter, cursor_death, datafix and 224 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/6728 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/tnt-minecarts` --- ### 📝 Commits (5) - [`ce2acb2`](https://github.com/horizon-rust/horizon/commit/ce2acb2cd5078d42313afbcfbd688b26a0062a06) TNT minecart landing: blast grows with the fall, in the landing tick - [`fb6af5b`](https://github.com/horizon-rust/horizon/commit/fb6af5b7fe0cf4949a540bf5d910ceead9ed0a58) Merge remote-tracking branch 'origin/main' into fix/tnt-minecarts - [`f602ae7`](https://github.com/horizon-rust/horizon/commit/f602ae73f6bbf436e5b3bed8eedfb106f1267d3a) Merge remote-tracking branch 'origin/main' into fix/tnt-minecarts - [`9f8a5e1`](https://github.com/horizon-rust/horizon/commit/9f8a5e144e93e7b2975596970c3e51670226a3d3) Merge remote-tracking branch 'origin/main' into fix/tnt-minecarts - [`a8ec405`](https://github.com/horizon-rust/horizon/commit/a8ec40548d5910e986777fcc850d05aaefdb1c1b) Regenerate the mod API output after the merge with main ### 📊 Changes **2 files changed** (+25 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/minecarts.rs` (+23 -8) 📝 `crates/horizon-client/src/mod_api/generated.rs` (+2 -1) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why A TNT minecart that lands from a fall of three blocks or more blew up with a fixed blast of power 4 (and one tick late), however far it fell. In vanilla the blast grows with the fall: power is 4 + a random 0 to 1.5 times the fall distance divided by 10 (up to 5). The landing also counted only the fall before the last move, so a cart that fell just over three blocks did not blow up at all. Changed: `crates/horizon-client/src/game/minecarts.rs`. The landing now counts the whole fall (not in water), and the cart blows up in the same tick with the vanilla speed `(fall / 10)` squared. Fixes #6727 ## 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 `MinecartTNT.causeFallDamage` (fall >= 3: `explode(ignitionSource, (fall/10)^2)`), `MinecartTNT.explode` (power = 4.0 + 1.0 * random * 1.5 * min(speed, 5)), `Entity.checkFallDamage` (the move's drop is added before the landing is handled; not in water). ## Numbers Side-by-side scene, TNT minecart dropped 40 blocks onto bedrock, pig with 1000 HP 6 blocks away, 24 drops each, damage to the pig: | | mean | min | max | |---|---|---|---| | vanilla | 42.1 | 12.0 | 76.6 | | Horizon after | 42.9 | 16.4 | 82.7 | | Horizon before (6 drops) | 9.75 every time | | | Pigs 9 and 12 blocks away were untouched before (6 of 6 drops); vanilla hurt them in 6 of 6. The cart disappeared on the same tick in vanilla and Horizon (tick 69). The blast power is random, so only the spread is comparable, not single drops. ## Not covered - Activator-rail fuse (80 ticks), a set fuse, and lit-arrow hits on one cart matched vanilla already. - Landing on hay, slime or bed blocks (vanilla scales the fall) is not compared. Part of #6431: this fixes the falling case only. #6134 is a different cause. Proved by script against the real 26.3 server; no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at e6f5a1ae7, 12 min 24 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +25 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 602 passed (34 s) | | rustfmt | ✅ (9 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ (2 min 56 s) | | tests: horizon-client, horizon-client-lib | ✅ 1962 passed (8 min 25 s) | | doc tests | ✅ 0 passed (7 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (7 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 236 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_removal, boat_authority, boat_paddle_reset, boat_submerged, command_exec, composter, crafter, cursor_death, datafix and 224 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:33: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#7059
No description provided.