This commit is contained in:
Brady 2023-06-26 16:25:21 -05:00
parent 452b2c278b
commit 3e94cac567
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 6 additions and 4 deletions

View File

@ -789,16 +789,18 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
} }
} }
private Pair<Float, Boolean> solvePitch(SolverContext context, Vec3d goalDelta, int relaxation, boolean ignoreLava) { private Pair<Float, Boolean> solvePitch(final SolverContext context, final Vec3d goalDelta,
final int steps = relaxation < 2 ? context.boost.isBoosted() ? 5 : Baritone.settings().elytraSimulationTicks.value : 3; final int relaxation, final boolean ignoreLava) {
final boolean desperate = relaxation == 2;
final int steps = desperate ? 3 : context.boost.isBoosted() ? 5 : Baritone.settings().elytraSimulationTicks.value;
final Float pitch = this.solvePitch(context, goalDelta, steps, relaxation == 2, context.boost.isBoosted(), ignoreLava); final Float pitch = this.solvePitch(context, goalDelta, steps, desperate, context.boost.isBoosted(), ignoreLava);
if (pitch != null) { if (pitch != null) {
return new Pair<>(pitch, false); return new Pair<>(pitch, false);
} }
if (Baritone.settings().experimentalTakeoff.value && relaxation > 0) { if (Baritone.settings().experimentalTakeoff.value && relaxation > 0) {
final Float usingFirework = this.solvePitch(context, goalDelta, steps, relaxation == 2, true, ignoreLava); final Float usingFirework = this.solvePitch(context, goalDelta, steps, desperate, true, ignoreLava);
if (usingFirework != null) { if (usingFirework != null) {
return new Pair<>(usingFirework, true); return new Pair<>(usingFirework, true);
} }