[PR #3443] [MERGED] Open shulker boxes with the shulker box menu on servers #4982

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3443
Author: @d3grando
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix-shulker-box-menu


📝 Commits (2)

  • 44d9bdd Open shulker boxes with the shulker box menu on servers
  • e2de446 Merge main into this branch

📊 Changes

7 files changed (+208 additions, -0 deletions)

View changed files

📝 crates/horizon-client-render/src/containers.rs (+18 -0)
📝 crates/horizon-client/examples/probe/main.rs (+2 -0)
➕ crates/horizon-client/examples/probe/storage_menu_fixture.rs (+37 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+6 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaStorageMenuOracle.java (+56 -0)
📝 tools/lan_e2e.py (+40 -0)
➕ tools/test_storage_menu_parity.py (+49 -0)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

What and why

In single player (which runs on its server thread), on LAN and on a dedicated server, a shulker box could be put inside another shulker box. Vanilla 26.3 opens a shulker box with ShulkerBoxMenu (menu type minecraft:shulker_box), whose ShulkerBoxSlots refuse shulker boxes. Horizon's server opened it as minecraft:generic_9x3, a plain chest menu. The server already refuses shulker boxes in a minecraft:shulker_box menu (lan::containers, ShulkerBoxSlot.mayPlace), but that check never ran because it never got that menu type. The client's prediction refused the click, the server accepted it, and the next sync put the box inside. A vanilla client joining a Horizon server also got a chest screen for shulker boxes.

lan_open_container now sends the block entity's own menu type, from the new horizon_client::containers::block_menu_type: 9x3 for chests, trapped and copper chests and barrels, shulker_box for shulker boxes of every colour, 3x3 for dispensers and droppers, hopper for hoppers. The client already handled minecraft:shulker_box (slot map, screen, remote_storage_open). In-frame play (--in-frame) already refused them and doesn't change.

The change in lan_actions.rs adds lines after the menu is chosen, so it doesn't overlap #3415's rewrite of the same function. Both merge cleanly in either order.

Vanilla reference

  • ShulkerBoxBlockEntity.createMenu → new ShulkerBoxMenu(id, inventory, this) → MenuType.SHULKER_BOX, and its ShulkerBoxSlot.mayPlace (Item.canFitInsideContainerItems).
  • ChestBlockEntity / BarrelBlockEntity.createMenu → ChestMenu.threeRows, DispenserBlockEntity.createMenu → DispenserMenu, HopperBlockEntity.createMenu → HopperMenu.

New harness tools/test_storage_menu_parity.py: VanillaStorageMenuOracle builds each block's block entity (marked removed, so opening needs no level), calls BaseContainerBlockEntity.createMenu, and prints the menu's MenuType and whether its first slot takes a shulker box. storage_menu_fixture answers with containers::block_menu_type. There are 31 blocks: chest, trapped chest, barrel, dispenser, dropper, hopper, the plain and 16 dyed shulker boxes, and 8 copper chest states.

  • With the fix: 31/31 cases match.
  • With the old menu type (shulker boxes as generic_9x3): 14/31, failing for all 17 shulker boxes.

New tools/lan_e2e.py check shulker_menu (for CI): a guest opens a shulker box and puts cobblestone and then a red shulker box in it with real mouse clicks. The box should hold only the cobblestone, and the red box should go back to the guest's inventory. lan_e2e doesn't run on Windows (Unix control sockets, os.symlink), so I checked the same flow by hand with horizon-ctl (below).

Self-check

Run on Windows 11, without tools/pr_ready.py (tools/parity.py stops on signal.SIGHUP on Windows):

  • cargo fmt --all --check: clean
  • cargo clippy -p horizon-client --features mods --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --features mods --bins: 139 + 18 passed
  • cargo test -p horizon-client --features mods --lib -- containers:: lan:: menu::: 65 passed (the full lib suite stalled on this loaded machine, so I ran only the modules this touches)
  • python tools/test_storage_menu_parity.py: 31/31 (14/31 with the old menu type)

Not run here: python3 tools/lan_e2e.py --check shulker_menu (needs Linux or macOS).

Screenshots

Single player (server thread), survival. A placed shulker box, cobblestone clicked into slot 1, then a red shulker box clicked onto slot 0, and the box opened again.

Before: the red shulker box went in (data get block … Items lists it in slot 0).
shulker before click
shulker before reopened

After: the slot refuses it and the red box stays on the cursor. When the box is opened again it holds only the cobblestone, and the red shulker box is back in the inventory.
shulker after click
shulker after reopened

Rebased on main after #3186

Rebased on main after #3186 (62a01db8f). containers.rs moved to crates/horizon-client-render/src/containers.rs, so block_menu_type is there now. horizon_client::containers::block_menu_type still works through horizon-client's re-export, which lan_actions.rs and storage_menu_fixture use. lan_actions.rs, the fixture and the harness didn't change.

Self-check after the rebase

Run on Windows 11, without tools/pr_ready.py (tools/parity.py stops on signal.SIGHUP on Windows):

  • cargo fmt --all --check: clean
  • cargo clippy -p horizon-client-render --all-targets -- -D warnings: clean
  • cargo clippy -p horizon-client --features mods --all-targets -- -D warnings: clean
  • cargo test -p horizon-client-render --lib -- containers::: 2 passed
  • cargo test -p horizon-client --features mods --lib -- containers:: lan:: menu::: 63 passed, 1 ignored
  • cargo test -p horizon-client --features mods --bins: 141 + 18 passed, 3 ignored
  • python tools/test_storage_menu_parity.py: 31/31 (14/31 with the old menu type)

Not run here: python3 tools/lan_e2e.py --check shulker_menu (needs Linux or macOS).

🤖 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/3443 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix-shulker-box-menu` --- ### 📝 Commits (2) - [`44d9bdd`](https://github.com/horizon-rust/horizon/commit/44d9bddebd3cfc78040296329c4bd4d94ab7601f) Open shulker boxes with the shulker box menu on servers - [`e2de446`](https://github.com/horizon-rust/horizon/commit/e2de4461288b83a133878dd732a0870481f9d682) Merge main into this branch ### 📊 Changes **7 files changed** (+208 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/containers.rs` (+18 -0) 📝 `crates/horizon-client/examples/probe/main.rs` (+2 -0) ➕ `crates/horizon-client/examples/probe/storage_menu_fixture.rs` (+37 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+6 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaStorageMenuOracle.java` (+56 -0) 📝 `tools/lan_e2e.py` (+40 -0) ➕ `tools/test_storage_menu_parity.py` (+49 -0) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why In single player (which runs on its server thread), on LAN and on a dedicated server, a shulker box could be put inside another shulker box. Vanilla 26.3 opens a shulker box with `ShulkerBoxMenu` (menu type `minecraft:shulker_box`), whose `ShulkerBoxSlot`s refuse shulker boxes. Horizon's server opened it as `minecraft:generic_9x3`, a plain chest menu. The server already refuses shulker boxes in a `minecraft:shulker_box` menu (`lan::containers`, `ShulkerBoxSlot.mayPlace`), but that check never ran because it never got that menu type. The client's prediction refused the click, the server accepted it, and the next sync put the box inside. A vanilla client joining a Horizon server also got a chest screen for shulker boxes. `lan_open_container` now sends the block entity's own menu type, from the new `horizon_client::containers::block_menu_type`: 9x3 for chests, trapped and copper chests and barrels, `shulker_box` for shulker boxes of every colour, 3x3 for dispensers and droppers, `hopper` for hoppers. The client already handled `minecraft:shulker_box` (slot map, screen, `remote_storage_open`). In-frame play (`--in-frame`) already refused them and doesn't change. The change in `lan_actions.rs` adds lines after the menu is chosen, so it doesn't overlap #3415's rewrite of the same function. Both merge cleanly in either order. ## Vanilla reference - `ShulkerBoxBlockEntity.createMenu` → `new ShulkerBoxMenu(id, inventory, this)` → `MenuType.SHULKER_BOX`, and its `ShulkerBoxSlot.mayPlace` (`Item.canFitInsideContainerItems`). - `ChestBlockEntity` / `BarrelBlockEntity.createMenu` → `ChestMenu.threeRows`, `DispenserBlockEntity.createMenu` → `DispenserMenu`, `HopperBlockEntity.createMenu` → `HopperMenu`. **New harness `tools/test_storage_menu_parity.py`**: `VanillaStorageMenuOracle` builds each block's block entity (marked removed, so opening needs no level), calls `BaseContainerBlockEntity.createMenu`, and prints the menu's `MenuType` and whether its first slot takes a shulker box. `storage_menu_fixture` answers with `containers::block_menu_type`. There are 31 blocks: chest, trapped chest, barrel, dispenser, dropper, hopper, the plain and 16 dyed shulker boxes, and 8 copper chest states. - With the fix: `31/31 cases match`. - With the old menu type (shulker boxes as `generic_9x3`): `14/31`, failing for all 17 shulker boxes. **New `tools/lan_e2e.py` check `shulker_menu`** (for CI): a guest opens a shulker box and puts cobblestone and then a red shulker box in it with real mouse clicks. The box should hold only the cobblestone, and the red box should go back to the guest's inventory. lan_e2e doesn't run on Windows (Unix control sockets, `os.symlink`), so I checked the same flow by hand with `horizon-ctl` (below). ## Self-check Run on Windows 11, without `tools/pr_ready.py` (`tools/parity.py` stops on `signal.SIGHUP` on Windows): - `cargo fmt --all --check`: clean - `cargo clippy -p horizon-client --features mods --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --features mods --bins`: 139 + 18 passed - `cargo test -p horizon-client --features mods --lib -- containers:: lan:: menu::`: 65 passed (the full lib suite stalled on this loaded machine, so I ran only the modules this touches) - `python tools/test_storage_menu_parity.py`: 31/31 (14/31 with the old menu type) Not run here: `python3 tools/lan_e2e.py --check shulker_menu` (needs Linux or macOS). ## Screenshots Single player (server thread), survival. A placed shulker box, cobblestone clicked into slot 1, then a red shulker box clicked onto slot 0, and the box opened again. Before: the red shulker box went in (`data get block … Items` lists it in slot 0). ![shulker before click](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shulker-before-click.png) ![shulker before reopened](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shulker-before-reopened.png) After: the slot refuses it and the red box stays on the cursor. When the box is opened again it holds only the cobblestone, and the red shulker box is back in the inventory. ![shulker after click](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shulker-after-click.png) ![shulker after reopened](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shulker-after-reopened.png) ## Rebased on main after #3186 Rebased on main after #3186 (62a01db8f). `containers.rs` moved to `crates/horizon-client-render/src/containers.rs`, so `block_menu_type` is there now. `horizon_client::containers::block_menu_type` still works through horizon-client's re-export, which `lan_actions.rs` and `storage_menu_fixture` use. `lan_actions.rs`, the fixture and the harness didn't change. ### Self-check after the rebase Run on Windows 11, without `tools/pr_ready.py` (`tools/parity.py` stops on `signal.SIGHUP` on Windows): - `cargo fmt --all --check`: clean - `cargo clippy -p horizon-client-render --all-targets -- -D warnings`: clean - `cargo clippy -p horizon-client --features mods --all-targets -- -D warnings`: clean - `cargo test -p horizon-client-render --lib -- containers::`: 2 passed - `cargo test -p horizon-client --features mods --lib -- containers:: lan:: menu::`: 63 passed, 1 ignored - `cargo test -p horizon-client --features mods --bins`: 141 + 18 passed, 3 ignored - `python tools/test_storage_menu_parity.py`: 31/31 (14/31 with the old menu type) Not run here: `python3 tools/lan_e2e.py --check shulker_menu` (needs Linux or macOS). 🤖 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 05:09:21 +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#4982
No description provided.