[PR #6031] [MERGED] Do not play hand animation when block interaction returns Consume (#5… #6615

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6031
Author: @Sticky-Bug
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/flower-pot-hand-animation


📝 Commits (1)

  • a254e5e Do not play hand animation when block interaction returns Consume (#5989)

📊 Changes

4 files changed (+22 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -1)
📝 crates/horizon-client/src/game/remote.rs (+1 -1)
📝 crates/horizon-world/src/level/interact.rs (+8 -0)
📝 crates/horizon-world/src/level/tests.rs (+10 -7)

📄 Description

Fixes #5989

Cause

In vanilla Minecraft, right-clicking an empty flower pot with an invalid item or an empty hand consumes the action (InteractionResult::Consume) to prevent placing blocks behind it, but does not swing the hand (InteractionResult.shouldSwing() returns false).

In Horizon, Game::use_hand in crates/horizon-client/src/game.rs unconditionally called self.swing_arm() whenever result.consumes_action() was true. This caused local single-player to play the swing animation and caused LAN servers (lan_actions.rs:1834) to report g.swings_started != swings and send a swing_packet back to guests.

Solution

  • Added InteractionResult::should_swing() to crates/horizon-world/src/level/interact.rs (true only for Success).
  • Gated self.swing_arm() on if result.should_swing() in use_hand.
  • Added assertions in crates/horizon-world/src/level/tests.rs.

🔄 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/6031 **Author:** [@Sticky-Bug](https://github.com/Sticky-Bug) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/flower-pot-hand-animation` --- ### 📝 Commits (1) - [`a254e5e`](https://github.com/horizon-rust/horizon/commit/a254e5ea31ff195769ced4bc79b8c201bb880723) Do not play hand animation when block interaction returns Consume (#5989) ### 📊 Changes **4 files changed** (+22 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -1) 📝 `crates/horizon-world/src/level/interact.rs` (+8 -0) 📝 `crates/horizon-world/src/level/tests.rs` (+10 -7) </details> ### 📄 Description Fixes #5989 ### Cause In vanilla Minecraft, right-clicking an empty flower pot with an invalid item or an empty hand consumes the action (`InteractionResult::Consume`) to prevent placing blocks behind it, but does not swing the hand (`InteractionResult.shouldSwing()` returns false). In Horizon, `Game::use_hand` in `crates/horizon-client/src/game.rs` unconditionally called `self.swing_arm()` whenever `result.consumes_action()` was true. This caused local single-player to play the swing animation and caused LAN servers (`lan_actions.rs:1834`) to report `g.swings_started != swings` and send a `swing_packet` back to guests. ### Solution - Added `InteractionResult::should_swing()` to `crates/horizon-world/src/level/interact.rs` (true only for `Success`). - Gated `self.swing_arm()` on `if result.should_swing()` in `use_hand`. - Added assertions in `crates/horizon-world/src/level/tests.rs`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:50 +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#6615
No description provided.