[PR #1716] [MERGED] Fix double-chest inventory and hotbar clicks #3711

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

📋 Pull Request Information

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

Base: main ← Head: t3/395312eb


📝 Commits (2)

  • c36e819 Fix double-chest inventory and hotbar clicks
  • b6ec56a Merge origin/main into double-chest click fix

📊 Changes

2 files changed (+107 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+35 -7)
📝 tools/lan_e2e.py (+72 -0)

📄 Description

🤖 Opened by rdbtCVS's AI agent (OpenCode, GPT-6.1-Sol).

What and why

Fixes #1505.
Fixes #1589.

Double chests expose 90 menu slots, but both remote click lookups stopped at 64. The lower player inventory and every hotbar slot therefore failed to send their clicks to the server.

  • Both remote_menu_ops and remote_slot_click now use the same inverse lookup over the complete menu mapping, stopping at the first unmapped slot.
  • A Rust regression covers the 63/64 boundary, hotbar indices 81/89, four- and five-row menus, the single-chest control, and invalid or unsupported slots.
  • lan_e2e.py --check large_chest checks actual mouse pickup and Shift-click transfers from all 36 player slots, for both host and guest. It reopens the chest to verify authoritative contents and includes single-chest controls.

Vanilla reference

Read the pinned Minecraft Java Edition 26.3 bytecode with javap:

  • ChestMenu constructor, sixRows, addChestGrid, and quickMoveStack: 54 chest slots followed by the standard 36 player slots; transfers use the full menu size.
  • AbstractContainerScreen.getHoveredSlot and slotClicked: inspect all menu slots and forward the selected slot's menu index.
  • MultiPlayerGameMode.handleContainerInput: predict and send the click against the complete open menu.

Validation

  • Before the fix, the mouse-event regression transferred menu index 63 and failed to pick up index 64 (Horizon slot 19), reproducing #1505. Both single-chest input controls passed.
  • After the fix, large_chest passed in both server-thread and in-frame hosting, with all 36 player slots transferring through ordinary and Shift clicks for the host and guest: 16 input/menu/player/mode cases passed.
  • Both hosting modes and the full self-check were re-run after merging main to resolve the appended-LAN-test conflict.
  • LAN checks ran offscreen with the existing private prepared-resource cache and disposable game, launcher, and XDG homes. The broader affected parity suite is listed below for CI.

Self-check

pr_ready (tools/pr_ready.py on archlinux, against origin/main at f2f58aca9, 7 min 38 s)

Check Result
Scope ✅ 2 files, +107 −7
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 252 passed (2 min 23 s)
rustfmt ✅ (34 s)
clippy ✅ (1 min 47 s)
tests: horizon-client ✅ 1202 passed (2 min 16 s)
doc tests ✅ 0 passed (6 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 148 affected, to run in CI (no vanilla data here): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, heightmap, hotbar, interaction_input, interaction_shape, inventory_pickup and 136 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with OpenCode (GPT-6.1-Sol).


🔄 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/1716 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/395312eb` --- ### 📝 Commits (2) - [`c36e819`](https://github.com/horizon-rust/horizon/commit/c36e81916b54c2640b4dc6b61b2fe54dbfa7b278) Fix double-chest inventory and hotbar clicks - [`b6ec56a`](https://github.com/horizon-rust/horizon/commit/b6ec56ac9b322c34472479f82d09946456b2e513) Merge origin/main into double-chest click fix ### 📊 Changes **2 files changed** (+107 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+35 -7) 📝 `tools/lan_e2e.py` (+72 -0) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (OpenCode, GPT-6.1-Sol). ## What and why Fixes #1505. Fixes #1589. Double chests expose 90 menu slots, but both remote click lookups stopped at 64. The lower player inventory and every hotbar slot therefore failed to send their clicks to the server. - Both `remote_menu_ops` and `remote_slot_click` now use the same inverse lookup over the complete menu mapping, stopping at the first unmapped slot. - A Rust regression covers the 63/64 boundary, hotbar indices 81/89, four- and five-row menus, the single-chest control, and invalid or unsupported slots. - `lan_e2e.py --check large_chest` checks actual mouse pickup and Shift-click transfers from all 36 player slots, for both host and guest. It reopens the chest to verify authoritative contents and includes single-chest controls. ## Vanilla reference Read the pinned Minecraft Java Edition 26.3 bytecode with `javap`: - `ChestMenu` constructor, `sixRows`, `addChestGrid`, and `quickMoveStack`: 54 chest slots followed by the standard 36 player slots; transfers use the full menu size. - `AbstractContainerScreen.getHoveredSlot` and `slotClicked`: inspect all menu slots and forward the selected slot's menu index. - `MultiPlayerGameMode.handleContainerInput`: predict and send the click against the complete open menu. ## Validation - Before the fix, the mouse-event regression transferred menu index 63 and failed to pick up index 64 (Horizon slot 19), reproducing #1505. Both single-chest input controls passed. - After the fix, `large_chest` passed in **both server-thread and in-frame hosting**, with all 36 player slots transferring through ordinary and Shift clicks for the host and guest: **16 input/menu/player/mode cases passed**. - Both hosting modes and the full self-check were re-run after merging `main` to resolve the appended-LAN-test conflict. - LAN checks ran offscreen with the existing private prepared-resource cache and disposable game, launcher, and XDG homes. The broader affected parity suite is listed below for CI. ## Self-check **pr_ready** (`tools/pr_ready.py` on archlinux, against origin/main at f2f58aca9, 7 min 38 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +107 −7 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 252 passed (2 min 23 s) | | rustfmt | ✅ (34 s) | | clippy | ✅ (1 min 47 s) | | tests: horizon-client | ✅ 1202 passed (2 min 16 s) | | doc tests | ✅ 0 passed (6 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 148 affected, to run in CI (no vanilla data here): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, heightmap, hotbar, interaction_input, interaction_shape, inventory_pickup and 136 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [OpenCode](https://opencode.ai) (GPT-6.1-Sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:36 +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#3711
No description provided.