diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 46a7f62e2..051cb5686 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -737,16 +737,20 @@ public final class Settings { public final Setting blockFreeLook = new Setting<>(false); /** - * Automatically elytra fly without having to force the client-sided rotations. Requires {@link #freeLook}. + * Automatically elytra fly without having to force the client-sided rotations. */ public final Setting elytraFreeLook = new Setting<>(false); /** * Forces the client-sided yaw rotation to an average of the last {@link #smoothLookTicks} of server-sided rotations. - * Requires {@link #freeLook}. */ public final Setting smoothLook = new Setting<>(false); + /** + * Same as {@link #smoothLook} but for elytra flying. + */ + public final Setting elytraSmoothLook = new Setting<>(true); + /** * The number of ticks to average across for {@link #smoothLook}; */ diff --git a/src/main/java/baritone/behavior/LookBehavior.java b/src/main/java/baritone/behavior/LookBehavior.java index 869b8efb8..133c00e73 100644 --- a/src/main/java/baritone/behavior/LookBehavior.java +++ b/src/main/java/baritone/behavior/LookBehavior.java @@ -112,10 +112,10 @@ public final class LookBehavior extends Behavior implements ILookBehavior { this.smoothPitchBuffer.pop(); } - if (Baritone.settings().freeLook.value) { + if ((ctx.player().isElytraFlying() && Baritone.settings().elytraFreeLook.value) || (!ctx.player().isElytraFlying() && Baritone.settings().freeLook.value)) { ctx.player().rotationYaw = this.prevRotation.getYaw(); ctx.player().rotationPitch = this.prevRotation.getPitch(); - } else if (Baritone.settings().smoothLook.value) { + } 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) @@ -328,13 +328,9 @@ public final class LookBehavior extends Behavior implements ILookBehavior { final Settings settings = Baritone.settings(); final boolean antiCheat = settings.antiCheatCompatibility.value; final boolean blockFreeLook = settings.blockFreeLook.value; - final boolean freeLook = settings.freeLook.value; - if (!freeLook && !settings.smoothLook.value) return CLIENT; if (!blockFreeLook && blockInteract) return CLIENT; - - // Regardless of if antiCheatCompatibility is enabled, if a blockInteract is requested then the player // rotation needs to be set somehow, otherwise Baritone will halt since objectMouseOver() will just be // whatever the player is mousing over visually. Let's just settle for setting it silently.