[PR #1170] [MERGED] Beacon on the menu engine; LAN guests use beacons #3384

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

📋 Pull Request Information

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

Base: main ← Head: fix/lan-guest-workstations-6


📝 Commits (1)

  • ca5404e Beacon on the menu engine; LAN guests use beacons

📊 Changes

14 files changed (+370 additions, -29 deletions)

View changed files

📝 crates/horizon-client/examples/menu_fixture.rs (+22 -0)
📝 crates/horizon-client/src/game.rs (+6 -0)
📝 crates/horizon-client/src/game/beacon.rs (+16 -6)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_stations.rs (+94 -1)
📝 crates/horizon-client/src/game/remote.rs (+9 -1)
📝 crates/horizon-client/src/game/remote_stations.rs (+11 -0)
📝 crates/horizon-client/src/game/stations.rs (+9 -16)
📝 crates/horizon-client/src/lan/hub.rs (+5 -0)
📝 crates/horizon-client/src/menu.rs (+101 -1)
📝 crates/horizon-protocol/src/packets/play.rs (+13 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMenuOracle.java (+15 -0)
📝 tools/lan_e2e.py (+43 -1)
📝 tools/test_menu_click_parity.py (+25 -3)

📄 Description

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

What

BeaconMenu now runs on horizon_client::menu (Kind::Beacon):

  • the payment slot (beacon_payment_items, one item);
  • quickMoveStack;
  • updateEffects, with BeaconBlockEntity.validateEffects.

It is verified against the vanilla class by test_menu_click_parity, with a new SET_BEACON op: valid and invalid powers for each pyramid level, plus a power no level gives.

ServerboundSetBeaconPacket is now in horizon-protocol (two Opt<VarInt> mob effect ids, with a byte-level test).

LAN:

  • The host opens minecraft:beacon for guests, with the block entity's levels and powers as data slots, kept current while the menu is open.
  • It applies a guest's powers to the block entity (power_select while the beam is up).
  • It drops the payment when the menu closes, as BeaconMenu.removed does.
  • Guests show the server's levels and powers, and their Done button sends the packet and closes the menu.

Single player's beacon clicks go through the engine too; the old slot rules and quick-move branch are removed.

New lan_e2e check: beacon. On a one-level pyramid, the guest pays an iron ingot, picks Haste and presses Done. The guest then gets Haste from the beacon, and the ingot is gone on the server.

Why

Part of #868: LAN guests couldn't use workstation menus. Thanks to @Tydragon00, who reported it in #848 (which #868 was split from).

Known gaps

  • A SetBeacon with no primary and a level 1-3 secondary is refused. Vanilla's validateEffects throws a NullPointerException on it (Holder.equals on the null primary), so no vanilla client sends it.

Stack (merge in this order): #1165 loom → #1166 stonecutter → #1167 grindstone → #1168 anvil + smithing table → #1169 enchanting table → #1170 beacon → #1172 crafter. Each PR's base is the previous branch, so its diff shows only its own menu(s); every branch is rebased on e730dc14.

How tested

Self-check

Run on the stack's tip, now rebased on origin/main e730dc14 (#1164 merged). Before #1164, origin/main didn't compile, so the runs on ee3ac165 had its one-line fix applied locally. The rebase only brings that same line in (git diff of the tested tree against the rebased tip: moving_pistons.rs only). PR 7 reran everything on its own tip.

cargo fmt --all -- --check                                   clean
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings   clean (exit 0)
cargo test -p horizon-client -p horizon-protocol             0 failed (horizon-client: 984 lib + 91 bin + 15 ctl + 7 integration; horizon-protocol: 63)
tools/test_menu_click_parity.py (all menus, seed 7)          8000/8000 cases match
  per menu while porting: grindstone 3000/3000, anvil+smithing 4000/4000,
  enchanting 3000/3000, beacon 2000/2000
tools/lan_e2e.py --check loom,stonecutter,grindstone,anvil,smithing,enchanting,beacon
  in-frame                                                   7/7 PASS
  --server-thread                                            7/7 PASS
tools/lan_e2e.py --check crafter (PR 7's tip)                PASS in-frame; with --server-thread, crafter,
                                                             containers and machines PASS
single player (horizon-ctl, the same checks on a solo world, run as each menu landed)
                                                             loom, stonecutter, grindstone, anvil, smithing, enchanting, beacon, crafter PASS
tools/parity.py --changed origin/main (PR 4's tip, on 36689738)   97 passed, 5 failed
  failed: ambient_sound, music, resource_pack, sound_engine, sound_event (the same 5
  fail on origin/main in this setup; see the next line)
tools/parity.py --changed origin/main (PR 7's tip)           97 passed, 5 failed
  failed: the same 5 sound harnesses. On origin/main e730dc14 in the same checkout they
  fail with the same first mismatch lines (music 314, sound_engine 2, sound_event 1992,
  resource_pack 14, ambient_sound 18011)

What needs Ludovic

Nothing to set up. When the stack is in, a LAN session on two machines is a good extra check: a guest using each of these workstations.

🤖 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/1170 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lan-guest-workstations-6` --- ### 📝 Commits (1) - [`ca5404e`](https://github.com/horizon-rust/horizon/commit/ca5404e52dcdf4c2cfcff16876e84946fba5bf79) Beacon on the menu engine; LAN guests use beacons ### 📊 Changes **14 files changed** (+370 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/menu_fixture.rs` (+22 -0) 📝 `crates/horizon-client/src/game.rs` (+6 -0) 📝 `crates/horizon-client/src/game/beacon.rs` (+16 -6) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_stations.rs` (+94 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+9 -1) 📝 `crates/horizon-client/src/game/remote_stations.rs` (+11 -0) 📝 `crates/horizon-client/src/game/stations.rs` (+9 -16) 📝 `crates/horizon-client/src/lan/hub.rs` (+5 -0) 📝 `crates/horizon-client/src/menu.rs` (+101 -1) 📝 `crates/horizon-protocol/src/packets/play.rs` (+13 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMenuOracle.java` (+15 -0) 📝 `tools/lan_e2e.py` (+43 -1) 📝 `tools/test_menu_click_parity.py` (+25 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What `BeaconMenu` now runs on `horizon_client::menu` (`Kind::Beacon`): - the payment slot (`beacon_payment_items`, one item); - `quickMoveStack`; - `updateEffects`, with `BeaconBlockEntity.validateEffects`. It is verified against the vanilla class by `test_menu_click_parity`, with a new `SET_BEACON` op: valid and invalid powers for each pyramid level, plus a power no level gives. `ServerboundSetBeaconPacket` is now in horizon-protocol (two `Opt<VarInt>` mob effect ids, with a byte-level test). **LAN:** - The host opens `minecraft:beacon` for guests, with the block entity's levels and powers as data slots, kept current while the menu is open. - It applies a guest's powers to the block entity (`power_select` while the beam is up). - It drops the payment when the menu closes, as `BeaconMenu.removed` does. - Guests show the server's levels and powers, and their Done button sends the packet and closes the menu. Single player's beacon clicks go through the engine too; the old slot rules and quick-move branch are removed. New lan_e2e check: `beacon`. On a one-level pyramid, the guest pays an iron ingot, picks Haste and presses Done. The guest then gets Haste from the beacon, and the ingot is gone on the server. ## Why Part of #868: LAN guests couldn't use workstation menus. Thanks to **@Tydragon00**, who reported it in #848 (which #868 was split from). ### Known gaps - A `SetBeacon` with no primary and a level 1-3 secondary is refused. Vanilla's `validateEffects` throws a NullPointerException on it (`Holder.equals` on the null primary), so no vanilla client sends it. **Stack (merge in this order):** #1165 loom → #1166 stonecutter → #1167 grindstone → #1168 anvil + smithing table → #1169 enchanting table → #1170 beacon → #1172 crafter. Each PR's base is the previous branch, so its diff shows only its own menu(s); every branch is rebased on `e730dc14`. ## How tested ### Self-check Run on the stack's tip, now rebased on origin/main `e730dc14` (#1164 merged). Before #1164, origin/main didn't compile, so the runs on `ee3ac165` had its one-line fix applied locally. The rebase only brings that same line in (`git diff` of the tested tree against the rebased tip: `moving_pistons.rs` only). PR 7 reran everything on its own tip. ``` cargo fmt --all -- --check clean set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings clean (exit 0) cargo test -p horizon-client -p horizon-protocol 0 failed (horizon-client: 984 lib + 91 bin + 15 ctl + 7 integration; horizon-protocol: 63) tools/test_menu_click_parity.py (all menus, seed 7) 8000/8000 cases match per menu while porting: grindstone 3000/3000, anvil+smithing 4000/4000, enchanting 3000/3000, beacon 2000/2000 tools/lan_e2e.py --check loom,stonecutter,grindstone,anvil,smithing,enchanting,beacon in-frame 7/7 PASS --server-thread 7/7 PASS tools/lan_e2e.py --check crafter (PR 7's tip) PASS in-frame; with --server-thread, crafter, containers and machines PASS single player (horizon-ctl, the same checks on a solo world, run as each menu landed) loom, stonecutter, grindstone, anvil, smithing, enchanting, beacon, crafter PASS tools/parity.py --changed origin/main (PR 4's tip, on 36689738) 97 passed, 5 failed failed: ambient_sound, music, resource_pack, sound_engine, sound_event (the same 5 fail on origin/main in this setup; see the next line) tools/parity.py --changed origin/main (PR 7's tip) 97 passed, 5 failed failed: the same 5 sound harnesses. On origin/main e730dc14 in the same checkout they fail with the same first mismatch lines (music 314, sound_engine 2, sound_event 1992, resource_pack 14, ambient_sound 18011) ``` ## What needs Ludovic Nothing to set up. When the stack is in, a LAN session on two machines is a good extra check: a guest using each of these workstations. 🤖 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-03 04:09:08 +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#3384
No description provided.