[PR #2204] [MERGED] Give the conduit its power and its attack #4101

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

📋 Pull Request Information

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

Base: main ← Head: fix/conduit-power


📝 Commits (2)

  • fcfd425 Give the conduit its power and its attack
  • e157c5a Tick conduits on the server without a renderer

📊 Changes

3 files changed (+315 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/block_entity_anim.rs (+59 -0)
📝 crates/horizon-client/src/game/block_entity_anims.rs (+255 -4)
📝 crates/horizon-client/src/game/levels.rs (+1 -0)

📄 Description

What and why

A conduit only animated: it gave no conduit power and attacked nothing. This adds the server side of ConduitBlockEntity.serverTick.

  • Every 40 game ticks the conduit looks again at its shape: the 3x3x3 around it must be water, and the frame blocks (#conduit_effect_block) in the three 5x5 rings are counted. It is active with 16 or more.
  • The activate and deactivate sounds play when that changes. While active the ambient sound plays every 80 ticks and the short ambient sound every 60 to 99 ticks.
  • While active, every player in water or rain within frames / 7 * 16 blocks gets conduit power for 260 ticks (ambient). This covers the local player and LAN guests.
  • With 42 or more frame blocks the conduit picks a random enemy in water or rain within 8 blocks, keeps it until it dies or leaves range, and hurts it for 4 magic damage every 40 ticks with the attack sound.
  • The client animation already works out its own "active" from the same world at the same ticks, so it stays in step. It now also gets the attack target, so the nautilus particles stream to it as in vanilla.

Left out: the saved Target tag (vanilla does not keep isActive either, so a loaded conduit just picks a target again), and dedicated servers without a window, which have no list of loaded conduits yet (the same limit the end gateway ticker has).

Vanilla reference

  • ConduitBlockEntity.serverTick, updateShape, applyEffects
  • ConduitBlockEntity.updateAndAttackTarget, updateDestroyTarget, selectNewTarget
  • Entity.isInWaterOrRain, Vec3i.closerThan

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/2204 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/conduit-power` --- ### 📝 Commits (2) - [`fcfd425`](https://github.com/horizon-rust/horizon/commit/fcfd425b94a719f80417b210bb671ed70db96aeb) Give the conduit its power and its attack - [`e157c5a`](https://github.com/horizon-rust/horizon/commit/e157c5a0a5043b74ccb36e7320d5b3a4bfcb12e8) Tick conduits on the server without a renderer ### 📊 Changes **3 files changed** (+315 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/block_entity_anim.rs` (+59 -0) 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+255 -4) 📝 `crates/horizon-client/src/game/levels.rs` (+1 -0) </details> ### 📄 Description ## What and why A conduit only animated: it gave no conduit power and attacked nothing. This adds the server side of `ConduitBlockEntity.serverTick`. - Every 40 game ticks the conduit looks again at its shape: the 3x3x3 around it must be water, and the frame blocks (`#conduit_effect_block`) in the three 5x5 rings are counted. It is active with 16 or more. - The activate and deactivate sounds play when that changes. While active the ambient sound plays every 80 ticks and the short ambient sound every 60 to 99 ticks. - While active, every player in water or rain within `frames / 7 * 16` blocks gets conduit power for 260 ticks (ambient). This covers the local player and LAN guests. - With 42 or more frame blocks the conduit picks a random enemy in water or rain within 8 blocks, keeps it until it dies or leaves range, and hurts it for 4 magic damage every 40 ticks with the attack sound. - The client animation already works out its own "active" from the same world at the same ticks, so it stays in step. It now also gets the attack target, so the nautilus particles stream to it as in vanilla. Left out: the saved `Target` tag (vanilla does not keep `isActive` either, so a loaded conduit just picks a target again), and dedicated servers without a window, which have no list of loaded conduits yet (the same limit the end gateway ticker has). ## Vanilla reference - `ConduitBlockEntity.serverTick`, `updateShape`, `applyEffects` - `ConduitBlockEntity.updateAndAttackTarget`, `updateDestroyTarget`, `selectNewTarget` - `Entity.isInWaterOrRain`, `Vec3i.closerThan` ## 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:41 +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#4101
No description provided.