[PR #6053] [MERGED] Lightning hits boats, minecarts and orbs, by box #6627

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

📋 Pull Request Information

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

Base: main ← Head: fix/lightning-hits-all


📝 Commits (3)

  • 5b14688 Lightning hits boats, minecarts and orbs, by box
  • bf890dc Merge main into lightning boxes (lan_e2e: lightning-box beside shulker_lift)
  • fee0fee Merge main into #6053 (lan_e2e: lightning-box beside boat_submerged)

📊 Changes

2 files changed (+134 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/lightning.rs (+67 -12)
📝 tools/lan_e2e.py (+67 -0)

📄 Description

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

What and why

thunder_hit (crates/horizon-client/src/game/lightning.rs) tested each entity's feet point against the strike box and ignored boats, minecarts and experience orbs. Vanilla LightningBolt.tick calls getEntities(this, AABB(x-3, y-3, z-3, x+3, y+9, z+3), isAlive) (a box test) and Entity.thunderHit on each (fire +1, ignite 8 s at 0, hurtServer(lightningBolt, 5.0)).
Now: mobs, dropped items and players are tested by their box; boats and minecarts get hurt_boat/hurt_cart(5.0) (5 x 10 > 40, destroyed; lightning does not prime a TNT cart); experience orbs take 5 (health 5, gone).

Fixes #6052

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 (tools/rea_vanilla.py, bytecode)

LightningBolt.tick, Entity.thunderHit, VehicleEntity.hurtServer (damage x 10, destroy above 40), ExperienceOrb.hurtServer (health -= damage, discard at 0).

Test

tools/lan_e2e.py --check lightning-box (real host + guest games). Reverted (file copy): fails, every entity survives, cow stays 10. Fixed: passes. Logs in scratchpad bolt/{reverted,fixed}.log.
Note: lan_e2e's entities lists mobs/items/orbs; boats are read with execute if entity ... run setblock markers, orbs from the state's entity counts.

Vanilla vs Horizon (same scene: bolt at 0.5,0.5; entities at offsets)

entity vanilla 26.3 server Horizon fixed Horizon before
boat 1.5 out gone gone alive
minecart 1.5 out gone gone alive
experience orb 1.5 out gone gone alive
boat feet 3.5 out (body inside) gone gone alive
cow feet 3.2 out health 5 health 5 health 10
boat 6 out (control) untouched untouched alive
Vanilla run: scratchpad bolt/vanilla.py (port 25681), result bolt/vanilla-result.txt.

Differs from the gap note (entity-gaps.md A/3)

Armour stand: NOT broken by lightning in vanilla (health 20 after the bolt; ArmorStand.hurtServer needs a tag lightning lacks). Horizon also leaves it, so nothing to change; the gap's "stand broken" is wrong.

Not compared / not done

  • Item frames, paintings, primed TNT, falling blocks (fire only, no visible effect) and cushions (still a point test): not in vanilla scene.
  • Fire ticks on boats/carts/orbs and item burn in vanilla: not compared. Player box is a fixed 0.6 x 1.8 (sneaking/swimming pose ignored). Dropped item box 0.25.
  • The cow later burns to death in Horizon within ~20 ticks; vanilla was read at 4 ticks only, so only the strike damage is compared.
  • Last edit after the e2e pass was a clippy-only change (dropped a no-op f64::from); pr_ready --quick passes (bolt-ready.txt), e2e not rerun after it.

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 c05ef84a5, 4 min 42 s)

Check Result
Scope ✅ 3 files, +134 −12
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 525 passed (22 s)
rustfmt ✅ (6 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 ✅ (58 s)
tests: horizon-client ✅ 1713 passed (3 min 11 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 ➖ 319 affected, to run in CI (--quick): block_removal, boat_paddle_reset, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair and 307 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
exit 0

🤖 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/6053 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lightning-hits-all` --- ### 📝 Commits (3) - [`5b14688`](https://github.com/horizon-rust/horizon/commit/5b14688cb48a4c7d44242f54ef2b03f7fa974e55) Lightning hits boats, minecarts and orbs, by box - [`bf890dc`](https://github.com/horizon-rust/horizon/commit/bf890dc48e3eeffb1fd34e867666528d1b8f8c16) Merge main into lightning boxes (lan_e2e: lightning-box beside shulker_lift) - [`fee0fee`](https://github.com/horizon-rust/horizon/commit/fee0fee89fbf06249932f5529c1364de2f172d08) Merge main into #6053 (lan_e2e: lightning-box beside boat_submerged) ### 📊 Changes **2 files changed** (+134 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lightning.rs` (+67 -12) 📝 `tools/lan_e2e.py` (+67 -0) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why `thunder_hit` (crates/horizon-client/src/game/lightning.rs) tested each entity's feet point against the strike box and ignored boats, minecarts and experience orbs. Vanilla `LightningBolt.tick` calls `getEntities(this, AABB(x-3, y-3, z-3, x+3, y+9, z+3), isAlive)` (a box test) and `Entity.thunderHit` on each (fire +1, ignite 8 s at 0, `hurtServer(lightningBolt, 5.0)`). Now: mobs, dropped items and players are tested by their box; boats and minecarts get `hurt_boat/hurt_cart(5.0)` (5 x 10 > 40, destroyed; lightning does not prime a TNT cart); experience orbs take 5 (health 5, gone). Fixes #6052 ## 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 (tools/rea_vanilla.py, bytecode) LightningBolt.tick, Entity.thunderHit, VehicleEntity.hurtServer (damage x 10, destroy above 40), ExperienceOrb.hurtServer (health -= damage, discard at 0). ## Test tools/lan_e2e.py `--check lightning-box` (real host + guest games). Reverted (file copy): fails, every entity survives, cow stays 10. Fixed: passes. Logs in scratchpad bolt/{reverted,fixed}.log. Note: lan_e2e's `entities` lists mobs/items/orbs; boats are read with `execute if entity ... run setblock` markers, orbs from the state's entity counts. ## Vanilla vs Horizon (same scene: bolt at 0.5,0.5; entities at offsets) | entity | vanilla 26.3 server | Horizon fixed | Horizon before | |---|---|---|---| | boat 1.5 out | gone | gone | alive | | minecart 1.5 out | gone | gone | alive | | experience orb 1.5 out | gone | gone | alive | | boat feet 3.5 out (body inside) | gone | gone | alive | | cow feet 3.2 out | health 5 | health 5 | health 10 | | boat 6 out (control) | untouched | untouched | alive | Vanilla run: scratchpad bolt/vanilla.py (port 25681), result bolt/vanilla-result.txt. ## Differs from the gap note (entity-gaps.md A/3) Armour stand: NOT broken by lightning in vanilla (health 20 after the bolt; ArmorStand.hurtServer needs a tag lightning lacks). Horizon also leaves it, so nothing to change; the gap's "stand broken" is wrong. ## Not compared / not done - Item frames, paintings, primed TNT, falling blocks (fire only, no visible effect) and cushions (still a point test): not in vanilla scene. - Fire ticks on boats/carts/orbs and item burn in vanilla: not compared. Player box is a fixed 0.6 x 1.8 (sneaking/swimming pose ignored). Dropped item box 0.25. - The cow later burns to death in Horizon within ~20 ticks; vanilla was read at 4 ticks only, so only the strike damage is compared. - Last edit after the e2e pass was a clippy-only change (dropped a no-op f64::from); pr_ready --quick passes (bolt-ready.txt), e2e not rerun after it. 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 c05ef84a5, 4 min 42 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +134 −12 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 525 passed (22 s) | | rustfmt | ✅ (6 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 | ✅ (58 s) | | tests: horizon-client | ✅ 1713 passed (3 min 11 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 | ➖ 319 affected, to run in CI (--quick): block_removal, boat_paddle_reset, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair and 307 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | exit 0 🤖 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:24:00 +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#6627
No description provided.