[PR #3149] [CLOSED] Creative inventory: keep clicks client-side, sync armour edits and drop items through server #4823

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3149
Author: @gemakfy
Created: 10/28/2026
Status: ❌ Closed

Base: main ← Head: fix/creative-inventory-sync-and-drop


📝 Commits (1)

  • aede534 Creative inventory: keep clicks client-side, sync armour edits and drop items through server

📊 Changes

2 files changed (+92 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+19 -3)
📝 crates/horizon-client/src/game/remote.rs (+73 -11)

📄 Description

What and why

Fixes two issues with the creative inventory:

  1. Item duplication/multiplication: Single-clicks inside the creative menu (including tab 11, Survival inventory) were dispatching ContainerClick packets to the server. The server cursor retained picked items while creative placements were sent via SetCreativeModeSlot, leading to server cursor desync and items duplicating across slots on subsequent clicks. Single-clicks now stay on the client menu.
  2. Armour desync in creative: Remote::update only checked slots 0..36; armour slots (5..=8) and offhand (45) are now included in creative slot synchronization, so removing/equipping armour in creative mode updates the server.
  3. Item throwing/deletion: Pressing Q on items in creative tabs or the survival tab now properly drops them into the world via SetCreativeModeSlot(slot: -1, item) rather than deleting them.
  4. Right-clicking outside the survival tab drops a single item (let one = right;).

Addresses #3090, #3121. Supersedes and completes #3120.

Vanilla reference

  • net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen.slotClicked
  • net.minecraft.client.multiplayer.MultiPlayerGameMode.handleCreativeModeItemDrop (ServerboundSetCreativeModeSlotPacket(-1, item))

Self-check

pr_ready (tools/pr_ready.py --quick on nixos, against origin/main at b6c936f82, 5 min 28 s)

Check Result
Scope ✅ 2 files, +92 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 398 passed (35 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 41 s)
tests: horizon-client ✅ 1263 passed (3 min 3 s)
doc tests ✅ 0 passed (3 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

🔄 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/3149 **Author:** [@gemakfy](https://github.com/gemakfy) **Created:** 10/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/creative-inventory-sync-and-drop` --- ### 📝 Commits (1) - [`aede534`](https://github.com/horizon-rust/horizon/commit/aede534f3c3873fadaefdd0e907781319427753c) Creative inventory: keep clicks client-side, sync armour edits and drop items through server ### 📊 Changes **2 files changed** (+92 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+19 -3) 📝 `crates/horizon-client/src/game/remote.rs` (+73 -11) </details> ### 📄 Description ## What and why Fixes two issues with the creative inventory: 1. **Item duplication/multiplication**: Single-clicks inside the creative menu (including tab 11, Survival inventory) were dispatching `ContainerClick` packets to the server. The server cursor retained picked items while creative placements were sent via `SetCreativeModeSlot`, leading to server cursor desync and items duplicating across slots on subsequent clicks. Single-clicks now stay on the client menu. 2. **Armour desync in creative**: `Remote::update` only checked slots 0..36; armour slots (5..=8) and offhand (45) are now included in creative slot synchronization, so removing/equipping armour in creative mode updates the server. 3. **Item throwing/deletion**: Pressing `Q` on items in creative tabs or the survival tab now properly drops them into the world via `SetCreativeModeSlot(slot: -1, item)` rather than deleting them. 4. Right-clicking outside the survival tab drops a single item (`let one = right;`). Addresses #3090, #3121. Supersedes and completes #3120. ## Vanilla reference - `net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen.slotClicked` - `net.minecraft.client.multiplayer.MultiPlayerGameMode.handleCreativeModeItemDrop` (`ServerboundSetCreativeModeSlotPacket(-1, item)`) ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on nixos, against origin/main at b6c936f82, 5 min 28 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +92 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 398 passed (35 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 41 s) | | tests: horizon-client | ✅ 1263 passed (3 min 3 s) | | doc tests | ✅ 0 passed (3 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 | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:12 +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#4823
No description provided.