[PR #1247] [MERGED] Fix Q drop animation with an empty hand #3453

Closed
opened 2026-11-03 04:09:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: t3/fix-q-drop-animation


📝 Commits (1)

  • 6d36d46 Fix empty-hand drop animations

📊 Changes

4 files changed (+65 additions, -18 deletions)

View changed files

📝 crates/horizon-client/examples/held_drop_fixture.rs (+10 -1)
📝 crates/horizon-client/src/game/remote.rs (+13 -10)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaHeldDropOracle.java (+36 -3)
📝 tools/test_held_drop_parity.py (+6 -4)

📄 Description

What and why

Pressing Q with an empty selected slot started a drop animation in normal single-player worlds and on multiplayer servers. Use the existing selected-slot removal helper to predict the drop, and swing the main hand only when it returns a nonempty stack. Keep vanilla's drop action packet for empty slots and ignore drop keys in spectator mode.

Addresses the empty-slot Q animation reported in #1233.

Vanilla reference

Followed the pinned 26.3 bytecode for MultiPlayerGameMode.dropItem: remove from the selected slot, send the drop action, and swing MAIN_HAND only when the removed stack is nonempty. Minecraft.handleKeybinds suppresses spectator drops.

Extended tools/test_held_drop_parity.py to run vanilla's real dropItem implementation and compare swing attempts and drop packet counts alongside inventory and drop counts. All 128 snapshots match vanilla, covering Q/Ctrl+Q, all four game modes, selected slots 0/8, empty/single/partial/full stacks, and repeated drops after emptying a stack.

Self-check

python3 tools/test_held_drop_parity.py: passed (128 snapshots).

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 022600481, 7 min 6 s)

Check Result
Scope ✅ 4 files, +65 −18
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 290 passed (35 s)
rustfmt ✅ (9 s)
clippy ✅ (1 min 28 s)
tests: horizon-client ✅ 1108 passed (4 min 44 s)
doc tests ✅ 0 passed (3 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 264 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 252 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/1247 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/fix-q-drop-animation` --- ### 📝 Commits (1) - [`6d36d46`](https://github.com/horizon-rust/horizon/commit/6d36d468e70d0aea524e61f32081879ea064fa3b) Fix empty-hand drop animations ### 📊 Changes **4 files changed** (+65 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/held_drop_fixture.rs` (+10 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+13 -10) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaHeldDropOracle.java` (+36 -3) 📝 `tools/test_held_drop_parity.py` (+6 -4) </details> ### 📄 Description ## What and why Pressing Q with an empty selected slot started a drop animation in normal single-player worlds and on multiplayer servers. Use the existing selected-slot removal helper to predict the drop, and swing the main hand only when it returns a nonempty stack. Keep vanilla's drop action packet for empty slots and ignore drop keys in spectator mode. Addresses the empty-slot Q animation reported in #1233. ## Vanilla reference Followed the pinned 26.3 bytecode for `MultiPlayerGameMode.dropItem`: remove from the selected slot, send the drop action, and swing `MAIN_HAND` only when the removed stack is nonempty. `Minecraft.handleKeybinds` suppresses spectator drops. Extended `tools/test_held_drop_parity.py` to run vanilla's real `dropItem` implementation and compare swing attempts and drop packet counts alongside inventory and drop counts. All **128 snapshots match vanilla**, covering Q/Ctrl+Q, all four game modes, selected slots 0/8, empty/single/partial/full stacks, and repeated drops after emptying a stack. ## Self-check `python3 tools/test_held_drop_parity.py`: passed (128 snapshots). **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 022600481, 7 min 6 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +65 −18 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 290 passed (35 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (1 min 28 s) | | tests: horizon-client | ✅ 1108 passed (4 min 44 s) | | doc tests | ✅ 0 passed (3 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 264 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 252 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:38 +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#3453
No description provided.