From 7dcd7384f14a6e8cf4ac7259a1754698b9219cfb Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 4 May 2019 15:01:11 -0700 Subject: [PATCH] allow overshooting traverse --- src/api/java/baritone/api/Settings.java | 7 +++++++ .../pathing/movement/movements/MovementTraverse.java | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 76ea0e9a..0c2c5d4b 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -215,6 +215,13 @@ public final class Settings { */ public final Setting sprintAscends = new Setting<>(true); + /** + * If we overshoot a traverse and end up one block beyond the destination, mark it as successful anyway. + *

+ * This helps with speed at >=20m/s + */ + public final Setting overshootTraverse = new Setting<>(true); + /** * When breaking blocks for a movement, wait until all falling blocks have settled before continuing */ diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index 4f7ae713..a9266f14 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -36,8 +36,6 @@ import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import java.util.Objects; - public class MovementTraverse extends Movement { /** @@ -230,7 +228,11 @@ public class MovementTraverse extends Movement { } if (isTheBridgeBlockThere) { - if (ctx.playerFeet().equals(dest)) { + BetterBlockPos feet = ctx.playerFeet(); + if (feet.equals(dest)) { + return state.setStatus(MovementStatus.SUCCESS); + } + if (Baritone.settings().overshootTraverse.value && (feet.equals(dest.add(getDirection())) || feet.equals(dest.add(getDirection()).add(getDirection())))) { return state.setStatus(MovementStatus.SUCCESS); } Block low = BlockStateInterface.get(ctx, src).getBlock();