[PR #2808] [MERGED] The shulker's body stays square to its block while the head turns (fixes #1661) #4628

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2808
Author: @levzzz5154
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/shulker-body-yaw


📝 Commits (2)

  • 00df6c6 The shulker's body stays square to its block while the head turns
  • a8903cb Merge upstream/main into fix/shulker-body-yaw

📊 Changes

1 file changed (+62 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/mobs/shulker.rs (+62 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself.

What and why

A shulker is fixed to a block face and never turns: Shulker.recreateFromPacket sets the body rotation to 0 and Shulker.ShulkerBodyRotationControl.clientTick is empty, so the body stays square to the block and only the head turns. Horizon turned a shulker's body like any other mob's, which is what #1661 reports ("Shulkers are able to rotate like normal entities instead of being locked to the side of a block").

The fix itself is already on main (PR #2311, merged as 620762444), but nothing held it in place: the entity model harness compares the model's parts and cannot see the entity's own rotation, and the shulker had no unit test at all. This pull request adds the missing test - it drives Mob::body_rotation_tick (the port of BodyRotationControl.clientTick) and Mob::look_control_tick (the port of ShulkerLookControl) and pins both halves of vanilla's behaviour: the body stays at 0 while the head still turns to its target.

Fixes #1661

Vanilla reference

  • net.minecraft.world.entity.monster.Shulker.recreateFromPacket - this.yBodyRot = 0.0F; this.yBodyRotO = 0.0F;: the body rotation starts at 0.
  • net.minecraft.world.entity.monster.Shulker.ShulkerBodyRotationControl.clientTick - empty, so the body rotation is never changed (the generic BodyRotationControl.clientTick is what turns a mob's body towards where it walks).
  • net.minecraft.world.entity.monster.Shulker.ShulkerLookControl.clampHeadRotationToBody - empty: the head is not clamped to the square body, and getMaxHeadYRot and getMaxHeadXRot are 180.
  • net.minecraft.world.entity.ai.control.BodyRotationControl.clientTick - the generic body rotation the shulker overrides.
  • net.minecraft.client.renderer.entity.LivingEntityRenderer.extractRenderState - the render state's yRot is the head rotation relative to the body (yHeadRot - yBodyRot), which is why a square body with a turning head is vanilla's shulker.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, against upstream/main at 1e3a9d53a, 5 min 19 s)

Check Result
Scope ✅ 1 files, +62 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 336 passed (18 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 18 s)
tests: horizon-client ✅ 1331 passed (2 min 52 s)
doc tests ✅ 0 passed (34 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 74 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 62 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The clippy row is red on upstream's own code, not on this branch: the 14 collapsible_if lints are in crates/horizon-world/src/datafix/*, which this pull request does not touch, and the same 14 appear on a pristine upstream/main with this toolchain (rustc 1.95.0). The CI's verify job on this pull request is green.

  • cargo test --locked -p horizon-client --lib -- shulker -> 3 passed; 0 failed (mobs::shulker::tests::the_body_stays_square_while_the_head_turns, mobs::shulker::tests::the_head_turns_to_its_target and an unrelated LAN menu test).
  • Negative control: with the shulker's branch in Mob::body_rotation_tick taken out, the new test fails - assertion 'left == right' failed: the shulker's body stays square to the block with left: 90.0, right: 0.0, the body turned with the mob.
  • python3 tools/test_entity_model_parity.py --filter shulker -> 37 cases compared over 1 layers ... entity model parity ok: the shulker's model (the lid, the shell and the peek) is vanilla's. The harness compares the model's parts, so it cannot see the entity's rotation, which is what the new test covers.
  • cargo fmt -p horizon-client -> no changes.

🤖 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/2808 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/shulker-body-yaw` --- ### 📝 Commits (2) - [`00df6c6`](https://github.com/horizon-rust/horizon/commit/00df6c646f77e737abee082157f71e9e27e213f4) The shulker's body stays square to its block while the head turns - [`a8903cb`](https://github.com/horizon-rust/horizon/commit/a8903cba07dfab8e4d31f432f53b575fc3abc612) Merge upstream/main into fix/shulker-body-yaw ### 📊 Changes **1 file changed** (+62 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/shulker.rs` (+62 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself. ## What and why A shulker is fixed to a block face and never turns: `Shulker.recreateFromPacket` sets the body rotation to 0 and `Shulker.ShulkerBodyRotationControl.clientTick` is empty, so the body stays square to the block and only the head turns. Horizon turned a shulker's body like any other mob's, which is what #1661 reports ("Shulkers are able to rotate like normal entities instead of being locked to the side of a block"). The fix itself is already on `main` (PR #2311, merged as `620762444`), but nothing held it in place: the entity model harness compares the model's *parts* and cannot see the entity's own rotation, and the shulker had no unit test at all. This pull request adds the missing test - it drives `Mob::body_rotation_tick` (the port of `BodyRotationControl.clientTick`) and `Mob::look_control_tick` (the port of `ShulkerLookControl`) and pins both halves of vanilla's behaviour: the body stays at 0 while the head still turns to its target. Fixes #1661 ## Vanilla reference - `net.minecraft.world.entity.monster.Shulker.recreateFromPacket` - `this.yBodyRot = 0.0F; this.yBodyRotO = 0.0F;`: the body rotation starts at 0. - `net.minecraft.world.entity.monster.Shulker.ShulkerBodyRotationControl.clientTick` - empty, so the body rotation is never changed (the generic `BodyRotationControl.clientTick` is what turns a mob's body towards where it walks). - `net.minecraft.world.entity.monster.Shulker.ShulkerLookControl.clampHeadRotationToBody` - empty: the head is not clamped to the square body, and `getMaxHeadYRot` and `getMaxHeadXRot` are 180. - `net.minecraft.world.entity.ai.control.BodyRotationControl.clientTick` - the generic body rotation the shulker overrides. - `net.minecraft.client.renderer.entity.LivingEntityRenderer.extractRenderState` - the render state's `yRot` is the head rotation *relative to the body* (`yHeadRot - yBodyRot`), which is why a square body with a turning head is vanilla's shulker. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, against upstream/main at 1e3a9d53a, 5 min 19 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +62 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 336 passed (18 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 18 s) | | tests: horizon-client | ✅ 1331 passed (2 min 52 s) | | doc tests | ✅ 0 passed (34 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 74 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 62 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The clippy row is red on upstream's own code, not on this branch: the 14 `collapsible_if` lints are in `crates/horizon-world/src/datafix/*`, which this pull request does not touch, and the same 14 appear on a pristine `upstream/main` with this toolchain (rustc 1.95.0). The CI's `verify` job on this pull request is green. - `cargo test --locked -p horizon-client --lib -- shulker` -> `3 passed; 0 failed` (`mobs::shulker::tests::the_body_stays_square_while_the_head_turns`, `mobs::shulker::tests::the_head_turns_to_its_target` and an unrelated LAN menu test). - Negative control: with the shulker's branch in `Mob::body_rotation_tick` taken out, the new test fails - `assertion 'left == right' failed: the shulker's body stays square to the block` with `left: 90.0, right: 0.0`, the body turned with the mob. - `python3 tools/test_entity_model_parity.py --filter shulker` -> `37 cases compared over 1 layers` ... `entity model parity ok`: the shulker's model (the lid, the shell and the peek) is vanilla's. The harness compares the model's parts, so it cannot see the entity's rotation, which is what the new test covers. - `cargo fmt -p horizon-client` -> no changes. 🤖 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>
bsakaguchi 2026-11-03 05:06:46 +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#4628
No description provided.