cherry pick remainWithExistingLookDirection from fork

This commit is contained in:
Leijurv 2023-06-18 19:31:51 -07:00
parent 411c43d90e
commit 6c8f2698d6
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 7 additions and 1 deletions

View File

@ -729,6 +729,12 @@ public final class Settings {
*/
public final Setting<Boolean> blockFreeLook = new Setting<>(false);
/**
* When true, the player will remain with its existing look direction as often as possible.
* Although, in some cases this can get it stuck, hence this setting to disable that behavior.
*/
public final Setting<Boolean> remainWithExistingLookDirection = new Setting<>(true);
/**
* Will cause some minor behavioral differences to ensure that Baritone works on anticheats.
* <p>

View File

@ -161,7 +161,7 @@ public final class RotationUtils {
}
public static Optional<Rotation> reachable(IPlayerContext ctx, BlockPos pos, double blockReachDistance, boolean wouldSneak) {
if (ctx.isLookingAt(pos)) {
if (BaritoneAPI.getSettings().remainWithExistingLookDirection.value && ctx.isLookingAt(pos)) {
/*
* why add 0.0001?
* to indicate that we actually have a desired pitch