[PR #4325] [MERGED] Pose a brushing arm like vanilla, in both hands #5561

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4325
Author: @MSedgeMC
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/4273-brush-arm-pose


📝 Commits (1)

  • 8a378f4 Pose a brushing arm like vanilla, in both hands

📊 Changes

1 file changed (+69 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/mobs/anim.rs (+69 -1)

📄 Description

Part of #4273 — the third-person arm pose. The first-person sweep is in #3951, so this does not close the issue.

Vanilla's AvatarRenderer.getArmPose builds the pose per hand: an item being used in that hand maps its getUseAnimation to an arm pose, and BrushItem returns BRUSH, whose HumanoidModel case is xRot = xRot * 0.5f - 0.62831855f; yRot = 0.0f. 0.62831855f is exactly f32 pi/5 (bit-identical, 0x3F20D97C), i.e. twice the ordinary ITEM pose's pi/10 — and both poseRightArm and poseLeftArm carry the same case, so the hand that holds the brush is the hand that poses. Horizon had no Brush arm pose at all, so a brushing player was drawn with an item arm at 18 degrees while the dust and sound played.

One file (crates/horizon-client/src/mobs/anim.rs): the ArmPose::Brush variant, its pose_arm case, and two selection arms — main hand and off hand — keyed on the literal minecraft:brush id with the same using-item predicate the bow, trident and crossbow arms use. Brushing from the off hand is real in this codebase (game/brush.rs brushes with slot == shield::OFFHAND_SLOT), and vanilla poses that arm identically. Brush is one-handed and does not affect the off-hand pose, matching vanilla, so shields, bows and tridents keep their existing paths.

What is proven: the test ran on a build box: cargo test -p horizon-client --lib brush -> 2 passed. It pins three things — a brush in use in the main hand gives the right arm -pi/5 with yRot 0, an ordinary item in use (a stick) still gives -pi/10, so the change cannot leak, and a brush in the off hand gives the left arm -pi/5 while the main hand stays at -pi/10, so the hands cannot swap. The vanilla numbers were re-read independently from the jar, including the float constant.

What is not proven: no screenshot, and pr_ready was not run on this branch — CI's verify is the workspace check. A brush that is merely held, not in use, keeps the ITEM pose, as vanilla's getUseItemRemainingTicks() > 0 requires.

Not in scope: the off-hand brush pose was the last gap I knew of in the third-person half; the tooltip, the use_cycle item model and the sculk event were already correct.


🔄 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/4325 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/4273-brush-arm-pose` --- ### 📝 Commits (1) - [`8a378f4`](https://github.com/horizon-rust/horizon/commit/8a378f441cb621580e2cb5b58274335f937e5b57) Pose a brushing arm like vanilla, in both hands ### 📊 Changes **1 file changed** (+69 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/anim.rs` (+69 -1) </details> ### 📄 Description Part of #4273 — the third-person arm pose. The first-person sweep is in #3951, so this does not close the issue. Vanilla's `AvatarRenderer.getArmPose` builds the pose per hand: an item being used in that hand maps its `getUseAnimation` to an arm pose, and `BrushItem` returns `BRUSH`, whose `HumanoidModel` case is `xRot = xRot * 0.5f - 0.62831855f; yRot = 0.0f`. `0.62831855f` is exactly f32 pi/5 (bit-identical, `0x3F20D97C`), i.e. twice the ordinary ITEM pose's pi/10 — and both `poseRightArm` and `poseLeftArm` carry the same case, so the hand that holds the brush is the hand that poses. Horizon had no `Brush` arm pose at all, so a brushing player was drawn with an item arm at 18 degrees while the dust and sound played. One file (`crates/horizon-client/src/mobs/anim.rs`): the `ArmPose::Brush` variant, its `pose_arm` case, and two selection arms — main hand and off hand — keyed on the literal `minecraft:brush` id with the same using-item predicate the bow, trident and crossbow arms use. Brushing from the off hand is real in this codebase (`game/brush.rs` brushes with `slot == shield::OFFHAND_SLOT`), and vanilla poses that arm identically. `Brush` is one-handed and does not affect the off-hand pose, matching vanilla, so shields, bows and tridents keep their existing paths. **What is proven:** the test ran on a build box: `cargo test -p horizon-client --lib brush` -> 2 passed. It pins three things — a brush in use in the main hand gives the right arm `-pi/5` with `yRot` 0, an ordinary item in use (a stick) still gives `-pi/10`, so the change cannot leak, and a brush in the off hand gives the *left* arm `-pi/5` while the main hand stays at `-pi/10`, so the hands cannot swap. The vanilla numbers were re-read independently from the jar, including the float constant. **What is not proven:** no screenshot, and `pr_ready` was not run on this branch — CI's `verify` is the workspace check. A brush that is merely held, not in use, keeps the ITEM pose, as vanilla's `getUseItemRemainingTicks() > 0` requires. Not in scope: the off-hand brush pose was the last gap I knew of in the third-person half; the tooltip, the `use_cycle` item model and the sculk event were already correct. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:25 +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#5561
No description provided.