[PR #3751] [MERGED] Creative display drops reach the server on a server connection (#3523) #5194

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3751
Author: @leifiyoo
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/creative-drop-items


📝 Commits (1)

  • bb6305d Keep creative display drops on a server connection

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)

📄 Description

🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo himself.

What and why

Fixes #3523.

On a server connection (single player's server thread, LAN, multiplayer), a throw on an item-tab display slot in the creative screen (Q, or a right-click) went through the local player_drop. That spawns the item entity only in the window's own list and sends nothing, so the stack vanished. The survival-tab throw (remote_creative_throw) and the carried-stack throw already send it.

This PR routes the display throw through remote_creative_throw when connected to a server: SetCreativeModeSlot to slot -1, which is what vanilla's handleCreativeModeItemDrop sends. Local play keeps player_drop. The change is 3 lines in creative_display_click.

Vanilla reference

  • CreativeModeInventoryScreen.slotClicked, item tab THROW branch: player.drop(toDrop, true, PREDICTED) then gameMode.handleCreativeModeItemDrop(toDrop)
  • MultiPlayerGameMode.handleCreativeModeItemDrop (sends ServerboundSetCreativeModeSlotPacket(-1, stack))

Open point: remote_creative_throw also swings the arm, as the survival throw does. I did not confirm whether vanilla's item-tab path swings in this case.

Not verified

  • No unit test: Game cannot be built in the unit tests, and the routing is one branch. The existing horizon-client lib tests pass (834, with the pr_ready run).
  • No game run on a server, so the fix is confirmed by reading the code and the vanilla source only. A check would need a server-thread session where the creative display Q or right-click reaches the server.
  • No parity harness covers creative drops (test_creative_parity.py covers tabs and search).
  • tools/parity.py (and so pr_ready's harness step) fails on this Windows machine with ModuleNotFoundError: No module named 'fcntl'. That is a Unix-only import in the tool, not this change.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main, against upstream/main at 2286d42b7, 7 min 13 s)

Scope                       1 file, +3 -0
Cargo.lock                  unchanged
Public tree                 ok
Python tests                416 passed (1 min 0 s)
rustfmt                     ok (9 s)
clippy                      ok (1 min 22 s)
tests: horizon-client       834 passed (3 min 58 s)
doc tests                   0 passed (37 s)
Parity                      FAIL on Windows: tools/parity.py imports fcntl (see Not verified)

🤖 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/3751 **Author:** [@leifiyoo](https://github.com/leifiyoo) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/creative-drop-items` --- ### 📝 Commits (1) - [`bb6305d`](https://github.com/horizon-rust/horizon/commit/bb6305da25ef21321e64faf359b6777aae4000a5) Keep creative display drops on a server connection ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo himself. ## What and why Fixes #3523. On a server connection (single player's server thread, LAN, multiplayer), a throw on an item-tab display slot in the creative screen (Q, or a right-click) went through the local `player_drop`. That spawns the item entity only in the window's own list and sends nothing, so the stack vanished. The survival-tab throw (`remote_creative_throw`) and the carried-stack throw already send it. This PR routes the display throw through `remote_creative_throw` when connected to a server: `SetCreativeModeSlot` to slot -1, which is what vanilla's `handleCreativeModeItemDrop` sends. Local play keeps `player_drop`. The change is 3 lines in `creative_display_click`. ## Vanilla reference - `CreativeModeInventoryScreen.slotClicked`, item tab THROW branch: `player.drop(toDrop, true, PREDICTED)` then `gameMode.handleCreativeModeItemDrop(toDrop)` - `MultiPlayerGameMode.handleCreativeModeItemDrop` (sends `ServerboundSetCreativeModeSlotPacket(-1, stack)`) Open point: `remote_creative_throw` also swings the arm, as the survival throw does. I did not confirm whether vanilla's item-tab path swings in this case. ## Not verified - No unit test: `Game` cannot be built in the unit tests, and the routing is one branch. The existing `horizon-client` lib tests pass (834, with the `pr_ready` run). - No game run on a server, so the fix is confirmed by reading the code and the vanilla source only. A check would need a server-thread session where the creative display Q or right-click reaches the server. - No parity harness covers creative drops (`test_creative_parity.py` covers tabs and search). - `tools/parity.py` (and so `pr_ready`'s harness step) fails on this Windows machine with `ModuleNotFoundError: No module named 'fcntl'`. That is a Unix-only import in the tool, not this change. ## Self-check ``` pr_ready (tools/pr_ready.py --base upstream/main, against upstream/main at 2286d42b7, 7 min 13 s) Scope 1 file, +3 -0 Cargo.lock unchanged Public tree ok Python tests 416 passed (1 min 0 s) rustfmt ok (9 s) clippy ok (1 min 22 s) tests: horizon-client 834 passed (3 min 58 s) doc tests 0 passed (37 s) Parity FAIL on Windows: tools/parity.py imports fcntl (see Not verified) ``` 🤖 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:10:52 +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#5194
No description provided.