mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Fixed encorrect head rotation when swimming/crawling
This commit is contained in:
parent
aff5920b0e
commit
0a32b1af06
1 changed files with 10 additions and 2 deletions
|
@ -208,14 +208,22 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
|||
* @param y New rotation Y
|
||||
*/
|
||||
private void updateHeadRotation(float headYaw, float headPitch) {
|
||||
head.yaw = attributes.isSleeping ? (Math.abs(attributes.interpolatorId.getMostSignificantBits()) % 2.8F) - 1.9F : headYaw / 57.29578F;
|
||||
|
||||
headYaw = attributes.isSleeping ? (Math.abs(attributes.interpolatorId.getMostSignificantBits()) % 2.8F) - 1.9F : headYaw / 57.29578F;
|
||||
headPitch = attributes.isSleeping ? 0.1f : headPitch / 57.29578F;
|
||||
|
||||
if (attributes.isSwimming && attributes.motionPitch != 0) {
|
||||
headPitch -= 0.9F;
|
||||
}
|
||||
|
||||
head.yaw = 0;
|
||||
head.roll = 0;
|
||||
|
||||
if (attributes.isSwimmingRotated) {
|
||||
head.roll = -headYaw;
|
||||
} else {
|
||||
head.yaw = headYaw;
|
||||
}
|
||||
|
||||
float pitch = (float)Math.toRadians(attributes.motionPitch);
|
||||
|
||||
head.pitch = MathHelper.clamp(headPitch, -1.25f - pitch, 0.5f - pitch);
|
||||
|
|
Loading…
Reference in a new issue