[PR #700] [MERGED] Give mob, beacon, sculk and splash effects to every player #2743

Closed
opened 2026-11-02 15:58:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/effects-every-player


📝 Commits (10+)

  • 45cbb4f LAN: a guest's chest, crafting table or sign no longer takes the host's mouse (#687)
  • a67a323 Server: one level per dimension, so players can be in different dimensions
  • b278436 Mobs see only the guests in their own level
  • 805d553 Give mob, beacon, sculk and splash effects to every player
  • d746be2 Merge main into feat/server-levels
  • 7733984 levels.rs: per-level block events carry u32 states (#674)
  • 95bdb96 Merge commit '805d5532e5' into HEAD
  • 9240aeb Input capture test: the mock Game has lan_acting (#687)
  • 3a8ba56 Merge commit '7733984e' into HEAD
  • a244200 Merge commit '95bdb96f' into HEAD

📊 Changes

25 files changed (+1044 additions, -241 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+34 -14)
📝 crates/horizon-client/src/game/agent.rs (+3 -0)
📝 crates/horizon-client/src/game/beacon.rs (+4 -0)
📝 crates/horizon-client/src/game/creaking.rs (+8 -0)
📝 crates/horizon-client/src/game/creatures.rs (+34 -7)
📝 crates/horizon-client/src/game/dedicated.rs (+12 -12)
📝 crates/horizon-client/src/game/falling_damage.rs (+1 -1)
📝 crates/horizon-client/src/game/integrated.rs (+2 -4)
📝 crates/horizon-client/src/game/lan.rs (+54 -6)
📝 crates/horizon-client/src/game/lan_actions.rs (+62 -10)
📝 crates/horizon-client/src/game/lan_mobs.rs (+7 -4)
📝 crates/horizon-client/src/game/lan_pvp.rs (+2 -2)
📝 crates/horizon-client/src/game/lan_trading.rs (+1 -1)
➕ crates/horizon-client/src/game/levels.rs (+350 -0)
📝 crates/horizon-client/src/game/potions.rs (+38 -28)
📝 crates/horizon-client/src/game/raids.rs (+18 -7)
📝 crates/horizon-client/src/game/remote.rs (+15 -0)
📝 crates/horizon-client/src/game/sculk.rs (+12 -0)
📝 crates/horizon-client/src/game/server_travel.rs (+141 -118)
📝 crates/horizon-client/src/lan/containers.rs (+2 -2)

...and 5 more files

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Task 4 of the server-thread work. Stacked on #697 (one level per dimension), so it targets feat/server-levels. It retargets to main once #695 and #697 merge.

Problem

On a server (the integrated server thread and the dedicated server), the host's Game has no player of its own. Effects applied only to self.player therefore reached nobody. On a LAN world they reached only the host. This covered:

  • beacons;
  • the warden's and sculk shriekers' darkness;
  • the elder guardian's mining fatigue;
  • splash potions, including the weaker splash of lingering potions;
  • the raid victory's Hero of the Village.

Fix

  • New Game::for_each_player(f). It runs f for the host's own player, if there is one, then for each guest in the level being ticked (hub.here, loaded, alive), each through as_guest. The effect code is split into a per-player body:
    • beacon_effects_on_player
    • darkness_on_player
    • elder_curse_player
    • splash_on_player
    • Hero of the Village with acting_uuid()
  • The elder guardian's curse sends a cursed guest GameEvent 10 (GUARDIAN_ELDER_EFFECT, param 1). The remote client now handles it: it shows the apparition and plays the curse sound, as ClientPacketListener.handleGameEvent does. The host's own sound and apparition play only for the host.

Mob melee and projectile effects (wither skeletons, strays, bogged, cave spiders…) already reached guests through guest_hit_by / as_guest, so they are unchanged.

Not in this PR: conduits have no server-side effect at all (only the client animation). Conduit Power is missing for every player, the host included. That is a separate feature.

Tests

  • tools/lan_e2e.py gains an effects check. It builds a 3x3 iron base with a speed beacon next to the host and waits up to 300 ticks for speed on both players.
server thread (--server-thread) in-frame LAN
before (origin stack, without this commit) FAIL: {'host': [], 'guest': []} n/a
after PASS: host speed, guest speed PASS: host speed, guest speed
  • cargo fmt --all --check: ok.
  • cargo clippy --workspace --all-targets -- -D warnings: ok.
  • cargo test -p horizon-client --lib: 817 passed, 1 failed. The failure was title::tests::delete_refuses_an_open_world_then_removes_it_with_its_lock ("World is already open in another instance"), a session-lock race between parallel tests. It is unrelated to this change and passes when rerun.
  • Local parity: one integration run covers #697 and this PR. The pass count follows in a comment.

🤖 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/700 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/effects-every-player` --- ### 📝 Commits (10+) - [`45cbb4f`](https://github.com/horizon-rust/horizon/commit/45cbb4f7d668cf578c8b8e7fca8f65d9112385fa) LAN: a guest's chest, crafting table or sign no longer takes the host's mouse (#687) - [`a67a323`](https://github.com/horizon-rust/horizon/commit/a67a323959a43dcfc2d853634b2d1f253b5fbf34) Server: one level per dimension, so players can be in different dimensions - [`b278436`](https://github.com/horizon-rust/horizon/commit/b2784363a138e8e4124428e369d8aa22851cffe7) Mobs see only the guests in their own level - [`805d553`](https://github.com/horizon-rust/horizon/commit/805d5532e541deb1888216c8ebfc15775d8b2ea5) Give mob, beacon, sculk and splash effects to every player - [`d746be2`](https://github.com/horizon-rust/horizon/commit/d746be2ca33d13ee73007589ca42863b5afaeb05) Merge main into feat/server-levels - [`7733984`](https://github.com/horizon-rust/horizon/commit/7733984e7898787e2e388ee0361475c67e27e9cc) levels.rs: per-level block events carry u32 states (#674) - [`95bdb96`](https://github.com/horizon-rust/horizon/commit/95bdb96f1611fb3ae4f0bc4148d22523f221bb32) Merge commit '805d5532e541deb1888216c8ebfc15775d8b2ea5' into HEAD - [`9240aeb`](https://github.com/horizon-rust/horizon/commit/9240aeb9ff8b315b38895dd24e64243a46bbd49b) Input capture test: the mock Game has lan_acting (#687) - [`3a8ba56`](https://github.com/horizon-rust/horizon/commit/3a8ba56c61b84bf310645d67738a91857dae0979) Merge commit '7733984e' into HEAD - [`a244200`](https://github.com/horizon-rust/horizon/commit/a244200097caf4e123ff4b86ddff0f888308f7a3) Merge commit '95bdb96f' into HEAD ### 📊 Changes **25 files changed** (+1044 additions, -241 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+34 -14) 📝 `crates/horizon-client/src/game/agent.rs` (+3 -0) 📝 `crates/horizon-client/src/game/beacon.rs` (+4 -0) 📝 `crates/horizon-client/src/game/creaking.rs` (+8 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+34 -7) 📝 `crates/horizon-client/src/game/dedicated.rs` (+12 -12) 📝 `crates/horizon-client/src/game/falling_damage.rs` (+1 -1) 📝 `crates/horizon-client/src/game/integrated.rs` (+2 -4) 📝 `crates/horizon-client/src/game/lan.rs` (+54 -6) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+62 -10) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+7 -4) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+2 -2) 📝 `crates/horizon-client/src/game/lan_trading.rs` (+1 -1) ➕ `crates/horizon-client/src/game/levels.rs` (+350 -0) 📝 `crates/horizon-client/src/game/potions.rs` (+38 -28) 📝 `crates/horizon-client/src/game/raids.rs` (+18 -7) 📝 `crates/horizon-client/src/game/remote.rs` (+15 -0) 📝 `crates/horizon-client/src/game/sculk.rs` (+12 -0) 📝 `crates/horizon-client/src/game/server_travel.rs` (+141 -118) 📝 `crates/horizon-client/src/lan/containers.rs` (+2 -2) _...and 5 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Task 4 of the server-thread work. Stacked on #697 (one level per dimension), so it targets `feat/server-levels`. It retargets to `main` once #695 and #697 merge. ## Problem On a server (the integrated server thread and the dedicated server), the host's `Game` has no player of its own. Effects applied only to `self.player` therefore reached **nobody**. On a LAN world they reached only the host. This covered: - beacons; - the warden's and sculk shriekers' darkness; - the elder guardian's mining fatigue; - splash potions, including the weaker splash of lingering potions; - the raid victory's Hero of the Village. ## Fix - New `Game::for_each_player(f)`. It runs `f` for the host's own player, if there is one, then for each guest in the level being ticked (`hub.here`, loaded, alive), each through `as_guest`. The effect code is split into a per-player body: - `beacon_effects_on_player` - `darkness_on_player` - `elder_curse_player` - `splash_on_player` - Hero of the Village with `acting_uuid()` - The elder guardian's curse sends a cursed guest `GameEvent` 10 (`GUARDIAN_ELDER_EFFECT`, param 1). The remote client now handles it: it shows the apparition and plays the curse sound, as `ClientPacketListener.handleGameEvent` does. The host's own sound and apparition play only for the host. Mob melee and projectile effects (wither skeletons, strays, bogged, cave spiders…) already reached guests through `guest_hit_by` / `as_guest`, so they are unchanged. **Not in this PR:** conduits have no server-side effect at all (only the client animation). Conduit Power is missing for every player, the host included. That is a separate feature. ## Tests - `tools/lan_e2e.py` gains an `effects` check. It builds a 3x3 iron base with a speed beacon next to the host and waits up to 300 ticks for `speed` on both players. | | server thread (`--server-thread`) | in-frame LAN | | --- | --- | --- | | before (origin stack, without this commit) | FAIL: `{'host': [], 'guest': []}` | n/a | | after | PASS: host `speed`, guest `speed` | PASS: host `speed`, guest `speed` | - `cargo fmt --all --check`: ok. - `cargo clippy --workspace --all-targets -- -D warnings`: ok. - `cargo test -p horizon-client --lib`: 817 passed, 1 failed. The failure was `title::tests::delete_refuses_an_open_world_then_removes_it_with_its_lock` ("World is already open in another instance"), a session-lock race between parallel tests. It is unrelated to this change and passes when rerun. - Local parity: one integration run covers #697 and this PR. The pass count follows in a comment. 🤖 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>
bsakaguchi 2026-11-02 15:58:43 +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#2743
No description provided.