From 02fc62f1c474b14553cc803eb912c519a8a1fd42 Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 26 Jun 2023 18:37:06 -0500 Subject: [PATCH] Stop simulation when goal reached --- src/main/java/baritone/behavior/ElytraBehavior.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/behavior/ElytraBehavior.java b/src/main/java/baritone/behavior/ElytraBehavior.java index 6a7e98f83..abfad1ed9 100644 --- a/src/main/java/baritone/behavior/ElytraBehavior.java +++ b/src/main/java/baritone/behavior/ElytraBehavior.java @@ -854,7 +854,7 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H } private List simulate(final ITickableAimProcessor aimProcessor, final Vec3d goalDelta, final float pitch, - final int ticks, int ticksBoosted, final boolean ignoreLava) { + final int ticks, int ticksBoosted, final boolean ignoreLava) { Vec3d delta = goalDelta; Vec3d motion = ctx.playerMotion(); AxisAlignedBB hitbox = ctx.player().getEntityBoundingBox(); @@ -865,6 +865,9 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H if (MC_1_12_Collision_Fix.bonk(ctx, hitbox)) { return null; } + if (delta.lengthSquared() < 1) { + break; + } final Rotation rotation = aimProcessor.nextRotation( RotationUtils.calcRotationFromVec3d(Vec3d.ZERO, delta, ctx.playerRotations()).withPitch(pitch) );