[PR #4980] [MERGED] Swap F in a chest with the off hand #5986

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

📋 Pull Request Information

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

Base: main ← Head: fix/4887-offhand-container-swap


📝 Commits (1)

  • b70cb22 Swap F in a chest with the off hand

📊 Changes

1 file changed (+73 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/lan/menu.rs (+73 -2)

📄 Description

🤖 Opened by doodlyyousuf's AI agent (OhMyAgent, grok-4.6), not by doodlyyousuf personally.

What and why

Pressing F while a chest or barrel is open created a ghost item: the client predicted an off-hand swap, the server ignored it.

Vanilla AbstractContainerMenu SWAP button 40 is the off hand even when the open menu has no off-hand slot. Horizon only mapped 40 on the inventory menu (container.is_none()), so a chest click never moved Guest.offhand.

LAN container SWAP now swaps the clicked slot with the off hand. A unit test covers F over a chest slot, an empty slot, and a hotbar slot of the open chest.

Fixes #4887

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

AbstractContainerMenu.doClick SWAP with button 40 (Inventory.SLOT_OFFHAND). No local cargo/rustc; python3 tools/check_public_tree.py passed. pr_ready and crate tests need CI.

Other projects' code

none

Self-check

No local cargo/rustc. Public tree check passed on commit. python3 tools/pr_ready.py needs CI.


🔄 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/4980 **Author:** [@doodlyyousuf](https://github.com/doodlyyousuf) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/4887-offhand-container-swap` --- ### 📝 Commits (1) - [`b70cb22`](https://github.com/horizon-rust/horizon/commit/b70cb22e9d094319f71c541be9a6ca7a9e5c9647) Swap F in a chest with the off hand ### 📊 Changes **1 file changed** (+73 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/menu.rs` (+73 -2) </details> ### 📄 Description > 🤖 Opened by doodlyyousuf's AI agent (OhMyAgent, grok-4.6), not by doodlyyousuf personally. ## What and why Pressing F while a chest or barrel is open created a ghost item: the client predicted an off-hand swap, the server ignored it. Vanilla `AbstractContainerMenu` SWAP button 40 is the off hand even when the open menu has no off-hand slot. Horizon only mapped 40 on the inventory menu (`container.is_none()`), so a chest click never moved `Guest.offhand`. LAN container SWAP now swaps the clicked slot with the off hand. A unit test covers F over a chest slot, an empty slot, and a hotbar slot of the open chest. Fixes #4887 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `AbstractContainerMenu.doClick` SWAP with button 40 (`Inventory.SLOT_OFFHAND`). No local `cargo`/`rustc`; `python3 tools/check_public_tree.py` passed. `pr_ready` and crate tests need CI. ## Other projects' code none ## Self-check No local `cargo`/`rustc`. Public tree check passed on commit. `python3 tools/pr_ready.py` needs CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:26 +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#5986
No description provided.