Skip to content

Commit d58d231

Browse files
authored
Fix Human movement by restoring the body rotation tick (#4301)
The 25w02a update (ac2bbe5) adapted HumanEntity to Mojang's new tickHeadTurn(float) signature but dropped the super call in the process. Mob.tickHeadTurn is solely bodyRotationControl.clientTick(), which is the only thing that ever writes yBodyRot, so the Human's yBodyRot was frozen at its spawn value. Since LookControl clamps yHeadRot to within getMaxHeadYRot() of yBodyRot while navigating, and this override copies yHeadRot onto yRot (the vector moveRelative steers by), the movement direction was pinned to a cone around that stale angle and MoveControl's steering was overwritten every tick. Humans walked into walls, moved sideways, and oscillated between two blocks.
1 parent d3d52c9 commit d58d231

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/org/spongepowered/common/entity/living/human/HumanEntity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ public void internalSetAbsorptionAmount(float amount) {
304304

305305
@Override
306306
protected void tickHeadTurn(final float p_110146_1_) {
307+
// Must run first, it is the only thing that updates yBodyRot, which the look control clamps yHeadRot against
308+
super.tickHeadTurn(p_110146_1_);
307309
// Make the body rotation follow head rotation
308310
this.setYRot(this.getYHeadRot());
309311
}

0 commit comments

Comments
 (0)