[PR #7603] Fix wither side heads snapping to a different rotation #7709

Open
opened 2026-11-03 07:22:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7603
Author: @Joansitoh
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/7483-wither-head-rotlerp


📝 Commits (3)

  • 3905859 Fix wither side heads snapping: WitherBoss.rotlerp does not wrap its result
  • 2a2efd0 Format wither test
  • 52b9839 Fix wither head step test target

📊 Changes

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

View changed files

📝 crates/horizon-client/src/mobs/wither.rs (+30 -4)

📄 Description

🤖 Opened by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally.

What

The wither's side heads used MoveControl.rotlerp, which wraps its result into 0..360. A head looking up (negative pitch) or a yaw crossing 0 jumped by ~360 in one tick, and the client's partial-tick lerp swept the head across the whole range for a frame. Now turn_heads uses a head_rotlerp that matches WitherBoss.rotlerp: a + clamp(Mth.wrapDegrees(b - a), -max, max), with no wrap of the result.

Vanilla reference

WitherBoss.rotlerp (L406-417), called from aiStep at L204 (pitch, max 40), L205 (yaw, max 10) and L207 (back to yBodyRot, max 10).

How tested

  • Unit tests in mobs/wither.rs with hand-computed vanilla values (e.g. rot(-5,-100,40) = -45, where the old code gave 315; rot(355,10,10) = 365) and a bounded-step loop.
  • tools/pr_ready.py --quick: rustfmt, clippy and doc tests pass. The only failure in the run was my own test's wrong target (fixed in a later commit), and the wither tests pass after the fix. Rerunning the full tests on the final head was not completed.
  • Parity: server_entities PASS. mob_ai did not finish locally (the run hit the time limit).
  • Remaining affected harnesses: run by CI's parity job.

Suggested label: none

Fixes #7483

🤖 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/7603 **Author:** [@Joansitoh](https://github.com/Joansitoh) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/7483-wither-head-rotlerp` --- ### 📝 Commits (3) - [`3905859`](https://github.com/horizon-rust/horizon/commit/390585920c663ae02ea9b66d7dd54e7d1209f2fa) Fix wither side heads snapping: WitherBoss.rotlerp does not wrap its result - [`2a2efd0`](https://github.com/horizon-rust/horizon/commit/2a2efd0675c9e8147815115a60307b75a3aa7576) Format wither test - [`52b9839`](https://github.com/horizon-rust/horizon/commit/52b98391e41a62b67a6a9b23a234800db8cf4db5) Fix wither head step test target ### 📊 Changes **1 file changed** (+30 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/wither.rs` (+30 -4) </details> ### 📄 Description > 🤖 Opened by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally. ## What The wither's side heads used `MoveControl.rotlerp`, which wraps its result into 0..360. A head looking up (negative pitch) or a yaw crossing 0 jumped by ~360 in one tick, and the client's partial-tick lerp swept the head across the whole range for a frame. Now `turn_heads` uses a `head_rotlerp` that matches `WitherBoss.rotlerp`: `a + clamp(Mth.wrapDegrees(b - a), -max, max)`, with no wrap of the result. ## Vanilla reference `WitherBoss.rotlerp` (L406-417), called from `aiStep` at L204 (pitch, max 40), L205 (yaw, max 10) and L207 (back to `yBodyRot`, max 10). ## How tested - Unit tests in `mobs/wither.rs` with hand-computed vanilla values (e.g. rot(-5,-100,40) = -45, where the old code gave 315; rot(355,10,10) = 365) and a bounded-step loop. - `tools/pr_ready.py --quick`: rustfmt, clippy and doc tests pass. The only failure in the run was my own test's wrong target (fixed in a later commit), and the wither tests pass after the fix. Rerunning the full tests on the final head was not completed. - Parity: `server_entities` PASS. `mob_ai` did not finish locally (the run hit the time limit). - Remaining affected harnesses: run by CI's parity job. Suggested label: none Fixes #7483 🤖 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>
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#7709
No description provided.