[PR #5580] [MERGED] Creative inventory: Q on a hotbar slot drops the item instead of deleting it (#3684) #6368

Closed
opened 2026-11-03 06:19:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5580
Author: @mariuslozo-boop
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/creative-tab-hotbar-throw


📝 Commits (3)

  • c9bfcdc Creative item tabs: Q on a hotbar slot drops the item instead of deleting it
  • 85ec4c8 lan_e2e creative_throw: clear each step's drops before the next
  • 5a6d492 Creative Survival Inventory tab: Q while carrying drops from the slot

📊 Changes

2 files changed (+176 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+47 -4)
📝 tools/lan_e2e.py (+129 -0)

📄 Description

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

What and why

Refs #3684 (only the point "Q in the creative inventory deletes the item"; the scale and description points stay open).

In a creative item tab, Q over a hotbar slot deleted the item: on a server (single player's server thread, LAN, dedicated) the menu's THROW cleared the slot, but the drop was never sent, because the post-processing only sent remote_creative_throw while the Survival Inventory tab was open. It now sends it for any creative tab (self.screen == Screen::Creative). Clicks outside the window go through remote_creative_drop, not the menu, so they can't drop twice.

Two cases of CreativeModeInventoryScreen.slotClicked were missing too:

  • Q over an item-tab hotbar slot while carrying a stack did nothing; vanilla drops one item from the slot (the whole stack with Ctrl) and keeps the carried stack. Ported as creative_throw_carrying.
  • The same on the Survival Inventory tab; the same function covers it and updates equipment like the menu path (armor and off-hand slots are on that tab).

The drop packet goes out before the slot update, as in vanilla.

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

CreativeModeInventoryScreen.slotClicked (the THROW branches for the hotbar of an item tab and for the inventory tab, ServerboundSetCreativeModeSlotPacket / handleCreativeModeItemDrop). Unchanged and checked: display slots, the search tab (Q goes into the search box), the Destroy Item slot (mouse only).

New tools/lan_e2e.py --check creative_throw, host and LAN guest: item-tab hotbar Q, Ctrl+Q, Q while carrying, Ctrl+Q with an empty hand; Q and Ctrl+Q over a display slot (1 and 64); Survival Inventory tab Q, Ctrl+Q and Q while carrying; each step's drops are counted and cleared. Without the fix: item-tab Q drops 0 (the item is gone), Ctrl+Q 0, the carrying cases do nothing. With the fix: all pass, and --check creative_tools still passes. Also tested by hand in a window (single player).

Parity: the first two commits ran through tools/parity.py --changed upstream/main on Linux (WSL, ~371 harnesses): all pass except remote_fireball, which fails the same way on clean upstream (23cd6895b: the guest-thrown egg is seen in 1 of 6 samples). The third commit (the inventory-tab carrying case) was not run through parity; no harness drives the creative screen.

Not tested: a dedicated-server guest end to end (same client code), armor and off-hand slots while carrying, Linux and the macOS Cmd key. The client-side drop throttle (canDropItems) is an older, separate gap.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on PCDKBLENDER, against upstream/main at 10b16c4b9, 7 min 33 s)

Check Result
Scope ✅ 2 files, +176 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 510 passed (1 min 0 s)
rustfmt ✅ (10 s)
clippy ✅ (1 min 3 s)
tests: horizon-client ✅ 1573 passed (5 min 12 s)
doc tests ✅ 0 passed (1 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 ❌ 373 affected (the runner needs fcntl, so it can't start on Windows; see the Linux run above)

🤖 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/5580 **Author:** [@mariuslozo-boop](https://github.com/mariuslozo-boop) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/creative-tab-hotbar-throw` --- ### 📝 Commits (3) - [`c9bfcdc`](https://github.com/horizon-rust/horizon/commit/c9bfcdcef7a2b9c2de6670d5b1585561eb34e376) Creative item tabs: Q on a hotbar slot drops the item instead of deleting it - [`85ec4c8`](https://github.com/horizon-rust/horizon/commit/85ec4c8c65ad63b0b39cf55e1843177a69e00a5d) lan_e2e creative_throw: clear each step's drops before the next - [`5a6d492`](https://github.com/horizon-rust/horizon/commit/5a6d49212647999d98a054b6eef3ab633d980879) Creative Survival Inventory tab: Q while carrying drops from the slot ### 📊 Changes **2 files changed** (+176 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+47 -4) 📝 `tools/lan_e2e.py` (+129 -0) </details> ### 📄 Description > 🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Opus 5.5), not by mariuslozo-boop personally. ## What and why Refs #3684 (only the point "Q in the creative inventory deletes the item"; the scale and description points stay open). In a creative item tab, Q over a hotbar slot deleted the item: on a server (single player's server thread, LAN, dedicated) the menu's THROW cleared the slot, but the drop was never sent, because the post-processing only sent `remote_creative_throw` while the Survival Inventory tab was open. It now sends it for any creative tab (`self.screen == Screen::Creative`). Clicks outside the window go through `remote_creative_drop`, not the menu, so they can't drop twice. Two cases of `CreativeModeInventoryScreen.slotClicked` were missing too: - Q over an item-tab hotbar slot **while carrying a stack** did nothing; vanilla drops one item from the slot (the whole stack with Ctrl) and keeps the carried stack. Ported as `creative_throw_carrying`. - The same on the **Survival Inventory tab**; the same function covers it and updates equipment like the menu path (armor and off-hand slots are on that tab). The drop packet goes out before the slot update, as in vanilla. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] 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 `CreativeModeInventoryScreen.slotClicked` (the THROW branches for the hotbar of an item tab and for the inventory tab, `ServerboundSetCreativeModeSlotPacket` / `handleCreativeModeItemDrop`). Unchanged and checked: display slots, the search tab (Q goes into the search box), the Destroy Item slot (mouse only). New `tools/lan_e2e.py --check creative_throw`, host and LAN guest: item-tab hotbar Q, Ctrl+Q, Q while carrying, Ctrl+Q with an empty hand; Q and Ctrl+Q over a display slot (1 and 64); Survival Inventory tab Q, Ctrl+Q and Q while carrying; each step's drops are counted and cleared. Without the fix: item-tab Q drops 0 (the item is gone), Ctrl+Q 0, the carrying cases do nothing. With the fix: all pass, and `--check creative_tools` still passes. Also tested by hand in a window (single player). Parity: the first two commits ran through `tools/parity.py --changed upstream/main` on Linux (WSL, ~371 harnesses): all pass except `remote_fireball`, which fails the same way on clean upstream (23cd6895b: the guest-thrown egg is seen in 1 of 6 samples). The third commit (the inventory-tab carrying case) was not run through parity; no harness drives the creative screen. Not tested: a dedicated-server guest end to end (same client code), armor and off-hand slots while carrying, Linux and the macOS Cmd key. The client-side drop throttle (`canDropItems`) is an older, separate gap. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on PCDKBLENDER, against upstream/main at 10b16c4b9, 7 min 33 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +176 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 510 passed (1 min 0 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (1 min 3 s) | | tests: horizon-client | ✅ 1573 passed (5 min 12 s) | | doc tests | ✅ 0 passed (1 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 | ❌ 373 affected (the runner needs `fcntl`, so it can't start on Windows; see the Linux run above) | 🤖 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 06:19:17 +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#6368
No description provided.