[PR #2244] [MERGED] Lightning scrapes oxidation off the copper it strikes and around it #4135

Closed
opened 2026-11-03 04:14:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2244
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/lightning-cleans-copper


📝 Commits (2)

  • 85a6ce0 Lightning scrapes oxidation off copper
  • 5d3e9d2 Clean copper for a skeleton trap's visual lightning too

📊 Changes

2 files changed (+100 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/lightning.rs (+17 -0)
📝 crates/horizon-world/src/level/tick.rs (+83 -0)

📄 Description

What and why

Lightning did not touch copper. In Java a strike on weathering copper (a block, a lightning rod, a door and so on) sets it back to fully unoxidized, keeping its properties, and then 3 to 5 random walks of 1 to 8 steps each scrape one oxidation step off the weathering copper they reach, with the spark particles (level event 3002). A waxed block is not changed but still starts the walks.

The new world function lightning_clear_copper does this on the first flash of a bolt, after the rod is powered, and the game calls it from one line in tick_bolts through a small helper. The walks use the level random in vanilla's order (BlockPos.randomInCube picks x, y, z in turn, up to 10 tries per step).

Vanilla reference

  • LightningBolt.clearCopperOnLightningStrike, randomWalkCleaningCopper, randomStepCleaningCopper, getStrikePosition
  • WeatheringCopper.getFirst, getPrevious
  • BlockPos.randomInCube / randomBetweenClosed

Self-check

cargo check -p horizon-client passes.


🔄 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/2244 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lightning-cleans-copper` --- ### 📝 Commits (2) - [`85a6ce0`](https://github.com/horizon-rust/horizon/commit/85a6ce09214e684be1810ee6530e85c4476407b3) Lightning scrapes oxidation off copper - [`5d3e9d2`](https://github.com/horizon-rust/horizon/commit/5d3e9d218dc9a74b712a91d0fe504b0ca532852d) Clean copper for a skeleton trap's visual lightning too ### 📊 Changes **2 files changed** (+100 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lightning.rs` (+17 -0) 📝 `crates/horizon-world/src/level/tick.rs` (+83 -0) </details> ### 📄 Description ## What and why Lightning did not touch copper. In Java a strike on weathering copper (a block, a lightning rod, a door and so on) sets it back to fully unoxidized, keeping its properties, and then 3 to 5 random walks of 1 to 8 steps each scrape one oxidation step off the weathering copper they reach, with the spark particles (level event 3002). A waxed block is not changed but still starts the walks. The new world function `lightning_clear_copper` does this on the first flash of a bolt, after the rod is powered, and the game calls it from one line in `tick_bolts` through a small helper. The walks use the level random in vanilla's order (`BlockPos.randomInCube` picks x, y, z in turn, up to 10 tries per step). ## Vanilla reference - `LightningBolt.clearCopperOnLightningStrike`, `randomWalkCleaningCopper`, `randomStepCleaningCopper`, `getStrikePosition` - `WeatheringCopper.getFirst`, `getPrevious` - `BlockPos.randomInCube` / `randomBetweenClosed` ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:56 +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#4135
No description provided.