[PR #6515] [MERGED] Lightning breaks a cushion by its box, not its centre #6927

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

📋 Pull Request Information

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

Base: main ← Head: fix/lightning-entity-kinds


📝 Commits (2)

  • 1bd7d0a Lightning breaks cushions by box, not by feet point
  • c7a6415 Merge remote-tracking branch 'origin/main' into fix/lightning-entity-kinds

📊 Changes

1 file changed (+6 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/game/lightning.rs (+6 -9)

📄 Description

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

What and why

A cushion was hit by lightning only when its feet point was inside the strike box. Vanilla tests the cushion's box. A cushion whose centre is just outside the strike box but whose 1 x 1 body reaches it was left standing.

Now thunder_hit (game/lightning.rs) tests the cushion's bounds against the strike box, like the boats, minecarts and orbs already do (#6053). The unused point test is removed.

Fixes #6514

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

LightningBolt.tick (getEntities(this, AABB(x-3, y-3, z-3, x+3, y+9, z+3), isAlive) then Entity.thunderHit), Cushion (BlockAttachedEntity) thunderHit/hurt: the cushion breaks and drops its item. Checked with /summon lightning_bolt on the real 26.3 server.

Checked kinds (real 26.3 server, bolt at 0.5, 100, 0.5)

kind vanilla Horizon
item frame, painting (also one whose centre is outside the box) survive survive (nothing to change)
primed TNT, falling block, armor stand survive, still there same
cushion, centre 3.3 out (box meets) breaks, drops 1 item before: stays, 0 items; after: breaks, 1 item
cushion 3.7 out (control) stays stays

Same scene, dropped items after the strike: vanilla 1, Horizon before 0, Horizon after 1.

Not covered

No lan_e2e check: cushions placed in-game need a seat setup not worth adding for an edge case. Side note: on a Horizon dedicated server @e[type=minecraft:cushion] returns 0 for existing cushions (command layer cannot see them), so the scene reads the dropped item instead.

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 01e150e30, 3 min 10 s)

Check Result
Scope ✅ 1 files, +6 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 595 passed (31 s)
rustfmt ✅ (7 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 ✅ (1 min 25 s)
tests: horizon-client ✅ 591 passed (1 min 5 s)
doc tests ✅ 0 passed (1 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
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/6515 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lightning-entity-kinds` --- ### 📝 Commits (2) - [`1bd7d0a`](https://github.com/horizon-rust/horizon/commit/1bd7d0a5c36839dcce8f60291fdabf789686de68) Lightning breaks cushions by box, not by feet point - [`c7a6415`](https://github.com/horizon-rust/horizon/commit/c7a641587bd6ebb30cb69d4e1353bc1dd797ab20) Merge remote-tracking branch 'origin/main' into fix/lightning-entity-kinds ### 📊 Changes **1 file changed** (+6 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lightning.rs` (+6 -9) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why A cushion was hit by lightning only when its feet point was inside the strike box. Vanilla tests the cushion's box. A cushion whose centre is just outside the strike box but whose 1 x 1 body reaches it was left standing. Now `thunder_hit` (game/lightning.rs) tests the cushion's bounds against the strike box, like the boats, minecarts and orbs already do (#6053). The unused point test is removed. Fixes #6514 ## 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 LightningBolt.tick (getEntities(this, AABB(x-3, y-3, z-3, x+3, y+9, z+3), isAlive) then Entity.thunderHit), Cushion (BlockAttachedEntity) thunderHit/hurt: the cushion breaks and drops its item. Checked with `/summon lightning_bolt` on the real 26.3 server. ## Checked kinds (real 26.3 server, bolt at 0.5, 100, 0.5) | kind | vanilla | Horizon | |---|---|---| | item frame, painting (also one whose centre is outside the box) | survive | survive (nothing to change) | | primed TNT, falling block, armor stand | survive, still there | same | | cushion, centre 3.3 out (box meets) | breaks, drops 1 item | before: stays, 0 items; after: breaks, 1 item | | cushion 3.7 out (control) | stays | stays | Same scene, dropped items after the strike: vanilla 1, Horizon before 0, Horizon after 1. ## Not covered No lan_e2e check: cushions placed in-game need a seat setup not worth adding for an edge case. Side note: on a Horizon dedicated server `@e[type=minecraft:cushion]` returns 0 for existing cushions (command layer cannot see them), so the scene reads the dropped item instead. 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 01e150e30, 3 min 10 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +6 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 595 passed (31 s) | | rustfmt | ✅ (7 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 | ✅ (1 min 25 s) | | tests: horizon-client | ✅ 591 passed (1 min 5 s) | | doc tests | ✅ 0 passed (1 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | 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:29:23 +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#6927
No description provided.