[PR #473] [MERGED] LAN: trial spawners and vaults see the guests #2590

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

📋 Pull Request Information

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

Base: main ← Head: fix/lan-trial-guests


📝 Commits (10+)

  • dac18e8 LAN: mobs target and attack guests
  • 327aa5a tools/lan_e2e.py: a world with commands, so the guest's commands run again
  • 600bae5 LAN guest: hurt by lava, fire, drowning, suffocation and the void; hungry from moving
  • 2e12123 tools/lan_e2e.py: hazards counts the food spent from full health
  • 36d7f02 LAN: PvP between the host and guests
  • e289980 LAN guest: their own ender chest, and double chests as 9x6
  • 64f7ecd tools/lan_e2e.py: containers takes its chests away
  • 257b5e9 tools/lan_e2e.py: containers waits for the server's menu before reading or taking
  • bc0cd9c LAN guest: a use packet uses the item alone
  • 11130e6 LAN guest: command feedback names the guest and shows its numbers

📊 Changes

22 files changed (+1255 additions, -134 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+74 -43)
📝 crates/horizon-client/src/game/agent.rs (+1 -1)
📝 crates/horizon-client/src/game/commands.rs (+9 -5)
📝 crates/horizon-client/src/game/control.rs (+12 -0)
📝 crates/horizon-client/src/game/creatures.rs (+74 -9)
📝 crates/horizon-client/src/game/hand.rs (+1 -0)
📝 crates/horizon-client/src/game/lan.rs (+10 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+136 -28)
➕ crates/horizon-client/src/game/lan_mobs.rs (+305 -0)
➕ crates/horizon-client/src/game/lan_pvp.rs (+110 -0)
📝 crates/horizon-client/src/game/remote.rs (+47 -1)
📝 crates/horizon-client/src/game/storage.rs (+7 -1)
📝 crates/horizon-client/src/game/trial_spawner.rs (+17 -4)
📝 crates/horizon-client/src/game/vault.rs (+10 -5)
📝 crates/horizon-client/src/lan/containers.rs (+26 -27)
📝 crates/horizon-client/src/lan/guest.rs (+6 -0)
📝 crates/horizon-client/src/lan/hub.rs (+3 -0)
📝 crates/horizon-client/src/lan/menu.rs (+72 -1)
📝 crates/horizon-client/src/lan/playerdata.rs (+6 -1)
📝 crates/horizon-client/src/motion/environment.rs (+21 -1)

...and 2 more files

📄 Description

Part of #462 (the LAN part). Stacked on #472: merge #466 → #467 → #470 → #471 → #472 first.

What vanilla does

PlayerDetector.NO_CREATIVE_PLAYERS (trial spawners) and INCLUDING_CREATIVE_PLAYERS (vaults, VaultSharedData.updateConnectedPlayersWithinRange) read level.getPlayers(), so every player in the world counts. VaultBlockEntity.Server.tryInsertKey records the UUID of the player who used the key in rewarded_players.

What changes

  • TrialSpawnerLevel::players() and the vault's players now include every guest in the world. Each guest brings its UUID, feet, eyes, height (1.5 when crouching), game mode and whether it is alive. Dead guests are included, as getPlayers includes them.
  • While a guest acts (as_guest), the vault uses the guest's UUID (acting_uuid). Before, a guest's key rewarded the host's UUID.
  • Guests have no effects yet, so a guest's omen is None: Bad Omen / Trial Omen on a guest can't turn a spawner ominous.

How it was verified

New two-client check in tools/lan_e2e.py, trials, with a host and a guest on this Mac (two offscreen clients via the control socket). The host is a spectator, so neither block detects it.

  • A zombie trial spawner placed 3 blocks from the guest goes waiting_for_players → active.
  • A vault 2 blocks from the guest goes active.
  • The guest uses a trial key on the vault: the vault goes unlocking, and its rewarded_players holds a UUID different from the host's.

Result: trials: PASS. Control: the same check without the Rust change fails with the trial spawner never saw the guest: waiting_for_players.

Follow-up (after a full 14-check run on the combined stack)

  • The trials check clears the air between its blocks: the spawner needs line of sight to the guest's eyes.
  • It also puts the host back where it stood after its spectator turn.

🤖 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/473 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lan-trial-guests` --- ### 📝 Commits (10+) - [`dac18e8`](https://github.com/horizon-rust/horizon/commit/dac18e8350600d38c4c6b95d987d4738b802185f) LAN: mobs target and attack guests - [`327aa5a`](https://github.com/horizon-rust/horizon/commit/327aa5af6e710b1aa0e3e10652ce0453943b6710) tools/lan_e2e.py: a world with commands, so the guest's commands run again - [`600bae5`](https://github.com/horizon-rust/horizon/commit/600bae5703d222c7b1bd3c51ee8e72b3be12557e) LAN guest: hurt by lava, fire, drowning, suffocation and the void; hungry from moving - [`2e12123`](https://github.com/horizon-rust/horizon/commit/2e1212346f411c06657dec6a68b35ea853430502) tools/lan_e2e.py: hazards counts the food spent from full health - [`36d7f02`](https://github.com/horizon-rust/horizon/commit/36d7f02802889397f0d3c1d71fffbd15a2025f54) LAN: PvP between the host and guests - [`e289980`](https://github.com/horizon-rust/horizon/commit/e289980c1ea486228c73d1b007f522c387cf4c28) LAN guest: their own ender chest, and double chests as 9x6 - [`64f7ecd`](https://github.com/horizon-rust/horizon/commit/64f7ecd3671cfa13a044f68c048885c02a34f021) tools/lan_e2e.py: containers takes its chests away - [`257b5e9`](https://github.com/horizon-rust/horizon/commit/257b5e9f2d76c3d39e84a13754b2363d846cb8e9) tools/lan_e2e.py: containers waits for the server's menu before reading or taking - [`bc0cd9c`](https://github.com/horizon-rust/horizon/commit/bc0cd9cc844853472e83c780e07ec3db2cbde7ad) LAN guest: a use packet uses the item alone - [`11130e6`](https://github.com/horizon-rust/horizon/commit/11130e6ef7bf8d75ed006d3b7c63a81a9110422a) LAN guest: command feedback names the guest and shows its numbers ### 📊 Changes **22 files changed** (+1255 additions, -134 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+74 -43) 📝 `crates/horizon-client/src/game/agent.rs` (+1 -1) 📝 `crates/horizon-client/src/game/commands.rs` (+9 -5) 📝 `crates/horizon-client/src/game/control.rs` (+12 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+74 -9) 📝 `crates/horizon-client/src/game/hand.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+10 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+136 -28) ➕ `crates/horizon-client/src/game/lan_mobs.rs` (+305 -0) ➕ `crates/horizon-client/src/game/lan_pvp.rs` (+110 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+47 -1) 📝 `crates/horizon-client/src/game/storage.rs` (+7 -1) 📝 `crates/horizon-client/src/game/trial_spawner.rs` (+17 -4) 📝 `crates/horizon-client/src/game/vault.rs` (+10 -5) 📝 `crates/horizon-client/src/lan/containers.rs` (+26 -27) 📝 `crates/horizon-client/src/lan/guest.rs` (+6 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+3 -0) 📝 `crates/horizon-client/src/lan/menu.rs` (+72 -1) 📝 `crates/horizon-client/src/lan/playerdata.rs` (+6 -1) 📝 `crates/horizon-client/src/motion/environment.rs` (+21 -1) _...and 2 more files_ </details> ### 📄 Description Part of #462 (the LAN part). Stacked on #472: merge #466 → #467 → #470 → #471 → #472 first. ## What vanilla does `PlayerDetector.NO_CREATIVE_PLAYERS` (trial spawners) and `INCLUDING_CREATIVE_PLAYERS` (vaults, `VaultSharedData.updateConnectedPlayersWithinRange`) read `level.getPlayers()`, so every player in the world counts. `VaultBlockEntity.Server.tryInsertKey` records the UUID of the player who used the key in `rewarded_players`. ## What changes - `TrialSpawnerLevel::players()` and the vault's players now include every guest in the world. Each guest brings its UUID, feet, eyes, height (1.5 when crouching), game mode and whether it is alive. Dead guests are included, as `getPlayers` includes them. - While a guest acts (`as_guest`), the vault uses the guest's UUID (`acting_uuid`). Before, a guest's key rewarded the host's UUID. - Guests have no effects yet, so a guest's omen is `None`: Bad Omen / Trial Omen on a guest can't turn a spawner ominous. ## How it was verified New two-client check in `tools/lan_e2e.py`, `trials`, with a host and a guest on this Mac (two offscreen clients via the control socket). The host is a spectator, so neither block detects it. - A zombie trial spawner placed 3 blocks from the guest goes `waiting_for_players` → `active`. - A vault 2 blocks from the guest goes `active`. - The guest uses a trial key on the vault: the vault goes `unlocking`, and its `rewarded_players` holds a UUID different from the host's. Result: `trials: PASS`. Control: the same check without the Rust change fails with `the trial spawner never saw the guest: waiting_for_players`. ## Follow-up (after a full 14-check run on the combined stack) - The `trials` check clears the air between its blocks: the spawner needs line of sight to the guest's eyes. - It also puts the host back where it stood after its spectator turn. 🤖 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:57:25 +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#2590
No description provided.