[PR #3917] [MERGED] Fix item model hand swap animation scale #5285

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3917
Author: @quintyo
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/hand-swap-scale


📝 Commits (4)

  • a554d6e Fix item model hand swap animation scale
  • 15a2236 Test swap scale from displayed item models
  • 880eb73 Cover spear swing across a held item switch
  • 6b54289 Keep the swap-scale PR narrowly scoped

📊 Changes

2 files changed (+66 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/first_person.rs (+56 -0)
📝 crates/horizon-client/src/game.rs (+10 -2)

📄 Description

🤖 Opened by quintyo's AI agent (OpenAI Codex), not by quintyo personally.

What and why

Found this while investigating #3768. Horizon was applying only 1 - hand_height to first-person equip displacement; Minecraft 26.3 also multiplies by the displayed item's swap_animation_scale. This change uses Horizon's existing item-model resolver, including component and resource-pack overrides.

Players will see spear equip transitions use the spear model's 1.95 scale. Items with the default scale remain unchanged.

Scope of #3768

A local differential state-trace run against the installed Minecraft 26.3 client compared 4,198 cases (382,344 output lines), including a spear jab followed immediately by switching to a wooden sword or an empty hand. In that scenario vanilla retains the spear's active swing while resetting attack charge for the newly held item, and Horizon matches those states. This PR therefore stays limited to the separate equip-displacement scale mismatch; it does not modify the cooldown/swing-speed behavior described in #3768. The spear-jab unit test was removed because it asserted existing vanilla behavior.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

Minecraft 26.3's FirstPersonHandsAndItems.extractRenderState resolves the displayed stack's scale. FirstPersonHandsAndItemsRenderer.submit multiplies it by 1 - lerp(oldHeight, height). The regression test checks spear and sword scales through item models and verifies a component override.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on quinty_pc, against upstream/main at f47c14d93, 2 min 17 s)

Check Result
Scope ✅ 2 files, +66 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 459 passed (1 min 28 s)
rustfmt ✅ (10 s)
clippy ✅ (11 s)
tests: horizon-client ✅ 865 passed (20 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher checks ➖ launcher untouched
Parity ➖ not run by --quick; local differential probe above covers the reported spear-switch scenario
Label No additional label needed for a fix

🤖 Generated with OpenAI Codex.


🔄 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/3917 **Author:** [@quintyo](https://github.com/quintyo) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/hand-swap-scale` --- ### 📝 Commits (4) - [`a554d6e`](https://github.com/horizon-rust/horizon/commit/a554d6e7c40c63205a285419b5dd0b6023bfe7c2) Fix item model hand swap animation scale - [`15a2236`](https://github.com/horizon-rust/horizon/commit/15a22366e3a98f20fff43db53842ea608cfb6872) Test swap scale from displayed item models - [`880eb73`](https://github.com/horizon-rust/horizon/commit/880eb7350fe58781a78f04eec209d7bb3c4e66f1) Cover spear swing across a held item switch - [`6b54289`](https://github.com/horizon-rust/horizon/commit/6b5428915b1deca86e66ce72d3a9584c32b93bd6) Keep the swap-scale PR narrowly scoped ### 📊 Changes **2 files changed** (+66 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/first_person.rs` (+56 -0) 📝 `crates/horizon-client/src/game.rs` (+10 -2) </details> ### 📄 Description > 🤖 Opened by quintyo's AI agent (OpenAI Codex), not by quintyo personally. ## What and why Found this while investigating #3768. Horizon was applying only `1 - hand_height` to first-person equip displacement; Minecraft 26.3 also multiplies by the displayed item's `swap_animation_scale`. This change uses Horizon's existing item-model resolver, including component and resource-pack overrides. Players will see spear equip transitions use the spear model's 1.95 scale. Items with the default scale remain unchanged. ## Scope of #3768 A local differential state-trace run against the installed Minecraft 26.3 client compared 4,198 cases (382,344 output lines), including a spear jab followed immediately by switching to a wooden sword or an empty hand. In that scenario vanilla retains the spear's active swing while resetting attack charge for the newly held item, and Horizon matches those states. This PR therefore stays limited to the separate equip-displacement scale mismatch; it does not modify the cooldown/swing-speed behavior described in #3768. The spear-jab unit test was removed because it asserted existing vanilla behavior. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference Minecraft 26.3's `FirstPersonHandsAndItems.extractRenderState` resolves the displayed stack's scale. `FirstPersonHandsAndItemsRenderer.submit` multiplies it by `1 - lerp(oldHeight, height)`. The regression test checks spear and sword scales through item models and verifies a component override. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on quinty_pc, against upstream/main at f47c14d93, 2 min 17 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +66 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 459 passed (1 min 28 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (11 s) | | tests: horizon-client | ✅ 865 passed (20 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher checks | ➖ launcher untouched | | Parity | ➖ not run by `--quick`; local differential probe above covers the reported spear-switch scenario | | Label | No additional label needed for a fix | 🤖 Generated with [OpenAI Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:31 +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#5285
No description provided.