fix nudgeToLevel with smoothLook

This commit is contained in:
Babbaj 2023-07-31 17:07:38 -04:00
parent 0ca173f5dc
commit 7aa3eda3f6
No known key found for this signature in database
GPG Key ID: F044309848A07CAC
1 changed files with 3 additions and 3 deletions

View File

@ -117,9 +117,9 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
ctx.player().rotationPitch = this.prevRotation.getPitch();
} else if ((ctx.player().isElytraFlying() && Baritone.settings().elytraSmoothLook.value) || (!ctx.player().isElytraFlying() && Baritone.settings().smoothLook.value)) {
ctx.player().rotationYaw = (float) this.smoothYawBuffer.stream().mapToDouble(d -> d).average().orElseGet(this.prevRotation::getYaw);
ctx.player().rotationPitch = ctx.player().isElytraFlying()
? (float) this.smoothPitchBuffer.stream().mapToDouble(d -> d).average().orElseGet(this.prevRotation::getPitch)
: this.prevRotation.getPitch();
if (ctx.player().isElytraFlying()) {
ctx.player().rotationPitch = (float) this.smoothPitchBuffer.stream().mapToDouble(d -> d).average().orElseGet(this.prevRotation::getPitch);
}
}
this.prevRotation = null;