[PR #4661] [MERGED] Bundles: the wheel selects in a crafting table's and a station's menu #5764

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4661
Author: @DenisHumen
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/bundle-wheel-in-stations


📝 Commits (1)

  • 2320037 Bundles: the wheel selects in a crafting table's and a station's menu

📊 Changes

4 files changed (+58 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game/bundles.rs (+8 -5)
📝 crates/horizon-client/src/game/lan_actions.rs (+36 -1)
📝 crates/horizon-client/src/game/lan_crafting.rs (+7 -0)
📝 crates/horizon-client/src/game/lan_stations.rs (+7 -0)

📄 Description

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

What

The mouse wheel selects an item in a bundle again with a crafting table, an enchanting table or another station open.

Fixes #4436

Why

AbstractContainerScreen.mouseScrolled offers the wheel to the hovered slot's BundleMouseActions in every container screen. The client then sends ServerboundSelectBundleItemPacket(slot, index) with the slot in the open menu, and the server calls containerMenu.setSelectedBundleItemIndex.

Horizon got this wrong in two places:

  • Client. bundle_slot took the wheel only when remote_storage_open() was true, that is in the inventory and chest-like menus. On the server thread single player is a server client too, so in a crafting table nothing scrolled.
  • Server. select_bundle_item read the packet's slot as the inventory menu's whenever the guest had no chest-like menu open. A crafting table's or a station's slot number (their own slots come first) landed on the wrong inventory slot.

Fix

  • Client (game/bundles.rs): the player's inventory and off hand take the wheel in any menu. A container's own slots still do only in chest-like menus.
  • Server (game/lan_actions.rs): with a crafting table or a station open, bundle_inventory_slot maps the menu slot past its own slots onto the inventory menu's numbering (main inventory and hotbar from 9, in the same order). A slot of the station's own is ignored.
  • New helpers lan_crafting_table_own_slots and lan_station_own_slots give how many slots of its own the open menu has.
  • New unit test bundle_slot_tests::station_menus_map_to_the_inventory_menu: a crafting table (10 own slots) and an enchanting table (2), at both ends and out of range.

Checked

  • cargo test -p horizon-client --bin horizon-client bundle_slot_tests: passes.
  • Not run in game: horizon-ctl launch and lan_e2e.py hang on this Windows machine before the world opens.
  • pr_ready:
    • title::tests::each_world_preset_writes_its_own_generator fails on Windows (os error 267), in a test this PR doesn't touch.
    • The clippy failure comes from lints new in clippy 1.96 in code this PR doesn't touch. cargo clippy -p horizon-client --no-deps reports nothing in the touched files.

pr_ready (tools/pr_ready.py --quick --base upstream/main on DenisPC, against upstream/main at 0a7ad01ed, 6 min 27 s)

Check Result
Scope ✅ 4 files, +58 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (1 min 8 s)
rustfmt ✅ (10 s)
clippy ❌ failed (21 s)
tests: horizon-client ❌ 798 passed, 1 failed (4 min 41 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/4661 **Author:** [@DenisHumen](https://github.com/DenisHumen) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/bundle-wheel-in-stations` --- ### 📝 Commits (1) - [`2320037`](https://github.com/horizon-rust/horizon/commit/23200373f65aa3953705ba0ac10edd9088d6111a) Bundles: the wheel selects in a crafting table's and a station's menu ### 📊 Changes **4 files changed** (+58 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/bundles.rs` (+8 -5) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+36 -1) 📝 `crates/horizon-client/src/game/lan_crafting.rs` (+7 -0) 📝 `crates/horizon-client/src/game/lan_stations.rs` (+7 -0) </details> ### 📄 Description > 🤖 Opened by DenisHumen's AI agent (Claude Code, Opus 5.5), not by DenisHumen personally. ## What The mouse wheel selects an item in a bundle again with a crafting table, an enchanting table or another station open. Fixes #4436 ## Why `AbstractContainerScreen.mouseScrolled` offers the wheel to the hovered slot's `BundleMouseActions` in every container screen. The client then sends `ServerboundSelectBundleItemPacket(slot, index)` with the slot in the open menu, and the server calls `containerMenu.setSelectedBundleItemIndex`. Horizon got this wrong in two places: - **Client.** `bundle_slot` took the wheel only when `remote_storage_open()` was true, that is in the inventory and chest-like menus. On the server thread single player is a server client too, so in a crafting table nothing scrolled. - **Server.** `select_bundle_item` read the packet's slot as the inventory menu's whenever the guest had no chest-like `menu` open. A crafting table's or a station's slot number (their own slots come first) landed on the wrong inventory slot. ## Fix - **Client** (`game/bundles.rs`): the player's inventory and off hand take the wheel in any menu. A container's own slots still do only in chest-like menus. - **Server** (`game/lan_actions.rs`): with a crafting table or a station open, `bundle_inventory_slot` maps the menu slot past its own slots onto the inventory menu's numbering (main inventory and hotbar from 9, in the same order). A slot of the station's own is ignored. - New helpers `lan_crafting_table_own_slots` and `lan_station_own_slots` give how many slots of its own the open menu has. - New unit test `bundle_slot_tests::station_menus_map_to_the_inventory_menu`: a crafting table (10 own slots) and an enchanting table (2), at both ends and out of range. ## Checked - `cargo test -p horizon-client --bin horizon-client bundle_slot_tests`: passes. - Not run in game: `horizon-ctl launch` and `lan_e2e.py` hang on this Windows machine before the world opens. - pr_ready: - `title::tests::each_world_preset_writes_its_own_generator` fails on Windows (os error 267), in a test this PR doesn't touch. - The clippy failure comes from lints new in clippy 1.96 in code this PR doesn't touch. `cargo clippy -p horizon-client --no-deps` reports nothing in the touched files. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DenisPC, against upstream/main at 0a7ad01ed, 6 min 27 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +58 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (1 min 8 s) | | rustfmt | ✅ (10 s) | | clippy | ❌ failed (21 s) | | tests: horizon-client | ❌ 798 passed, 1 failed (4 min 41 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:14:49 +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#5764
No description provided.