[PR #448] [MERGED] Dropping from a menu swings the hand #2572

Closed
opened 2026-11-02 15:57:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/448
Author: @ludovic111
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @ludovic111

Base: main ← Head: fix/drop-swing


📝 Commits (1)

  • 03fe857 Dropping from a menu swings the hand

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game.rs (+4 -2)

📄 Description

Fixes #442

What vanilla does

LivingEntity.drop(stack, thrownFromHand, prediction) starts with this.swing(InteractionHand.MAIN_HAND, SwingAnimation.DEFAULT, …). Every drop swings the main hand:

  • AbstractContainerMenu.doClick with ContainerInput.THROW (Q over a slot) calls player.drop(itemStack, true, PREDICTED);
  • CreativeModeInventoryScreen.slotClicked throws a tab item or the carried stack with player.drop(…);
  • MultiPlayerGameMode.dropItem (Q in game) swings as well.

With the inventory open, the swing shows on the player model in the inventory and on the first-person hand behind the screen.

What was wrong

Horizon swung the hand only for the drop key in game (drop_held → swing_arm). player_drop, the port of Player.drop that menu throws, creative drops and full-inventory spills go through, never swung.

Fix

player_drop swings the main hand itself (Hand::Main, SwingAnimation::DEFAULT), and drop_held no longer swings a second time.

Verified in game (offscreen, control socket, Mac mini)

Survival, inventory open, cursor over 64 cobblestone, key q tap. One frame later, the background shows the thrown cobblestone right in front of the camera. One tick later, the inventory's player model has its right arm mid-swing across the body (before the press it hung at its side). The slot went 64 → 63.

Self-check

  • cargo fmt --check, cargo clippy -p horizon-client --all-targets -- -D warnings: clean.
  • horizon-client tests and the parity harnesses run once on an integration branch together with #446/#447; the results are in the thread's report.

On servers, Q over a slot isn't sent as a THROW click yet (separate gap, not touched here).

🤖 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/448 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/drop-swing` --- ### 📝 Commits (1) - [`03fe857`](https://github.com/horizon-rust/horizon/commit/03fe857ec2c5b49577257828a0e19fa82224f6bd) Dropping from a menu swings the hand ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -2) </details> ### 📄 Description Fixes #442 ## What vanilla does `LivingEntity.drop(stack, thrownFromHand, prediction)` starts with `this.swing(InteractionHand.MAIN_HAND, SwingAnimation.DEFAULT, …)`. Every drop swings the main hand: - `AbstractContainerMenu.doClick` with `ContainerInput.THROW` (Q over a slot) calls `player.drop(itemStack, true, PREDICTED)`; - `CreativeModeInventoryScreen.slotClicked` throws a tab item or the carried stack with `player.drop(…)`; - `MultiPlayerGameMode.dropItem` (Q in game) swings as well. With the inventory open, the swing shows on the player model in the inventory and on the first-person hand behind the screen. ## What was wrong Horizon swung the hand only for the drop key in game (`drop_held` → `swing_arm`). `player_drop`, the port of `Player.drop` that menu throws, creative drops and full-inventory spills go through, never swung. ## Fix `player_drop` swings the main hand itself (`Hand::Main`, `SwingAnimation::DEFAULT`), and `drop_held` no longer swings a second time. ## Verified in game (offscreen, control socket, Mac mini) Survival, inventory open, cursor over 64 cobblestone, `key q tap`. One frame later, the background shows the thrown cobblestone right in front of the camera. One tick later, the inventory's player model has its right arm mid-swing across the body (before the press it hung at its side). The slot went 64 → 63. ## Self-check - `cargo fmt --check`, `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean. - horizon-client tests and the parity harnesses run once on an integration branch together with #446/#447; the results are in the thread's report. On servers, Q over a slot isn't sent as a THROW click yet (separate gap, not touched here). 🤖 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-02 15:57:18 +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#2572
No description provided.