[PR #7802] A struck lightning rod unpowers after 8 ticks #7832

Open
opened 2026-11-03 07:25:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7802
Author: @xFedeT
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/lightning-rod-unpower


📝 Commits (1)

  • 1f5ebb0 A struck lightning rod schedules its unpowering

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/lightning.rs (+4 -1)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Fixes #7495

A lightning rod struck by a bolt (or a Channeling trident) stayed powered for good, so it kept drawing its lightning_rod_on texture, an almost white one (the "white rod" of the report).

LightningRodBlock.onLightningStrike sets powered, then level.scheduleTick(pos, this, 8): the tick that unpowers it. Game::strike_rod only set the state and said the rod's placement schedules the tick; but the rod is the same block before and after, and the block's onPlace hook schedules only for a block that is new (!same), so nothing was scheduled. strike_rod now schedules the 8-tick tick itself.

Checked in game (default server thread, horizon-ctl): setblock … lightning_rod[facing=up], summon lightning_bolt on it, polling the block: before this change powered=true stayed for the 4 s I watched; with it powered=true at 356 ms and powered=false at 765 ms, 8 ticks later. No unit test: strike_rod runs inside Game, which has no unit fixture (the world's own unpowering tick is covered in horizon-world's level tests). cargo clippy -p horizon-client --tests.

🤖 Generated with Claude 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/7802 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/lightning-rod-unpower` --- ### 📝 Commits (1) - [`1f5ebb0`](https://github.com/horizon-rust/horizon/commit/1f5ebb03eb6edf8cf8002cabb146a8f3dfe3590b) A struck lightning rod schedules its unpowering ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lightning.rs` (+4 -1) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #7495 A lightning rod struck by a bolt (or a Channeling trident) stayed powered for good, so it kept drawing its `lightning_rod_on` texture, an almost white one (the "white rod" of the report). `LightningRodBlock.onLightningStrike` sets `powered`, then `level.scheduleTick(pos, this, 8)`: the tick that unpowers it. `Game::strike_rod` only set the state and said the rod's placement schedules the tick; but the rod is the same block before and after, and the block's `onPlace` hook schedules only for a block that is new (`!same`), so nothing was scheduled. `strike_rod` now schedules the 8-tick tick itself. Checked in game (default server thread, `horizon-ctl`): `setblock … lightning_rod[facing=up]`, `summon lightning_bolt` on it, polling the block: before this change `powered=true` stayed for the 4 s I watched; with it `powered=true` at 356 ms and `powered=false` at 765 ms, 8 ticks later. No unit test: `strike_rod` runs inside `Game`, which has no unit fixture (the world's own unpowering tick is covered in `horizon-world`'s level tests). `cargo clippy -p horizon-client --tests`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7832
No description provided.