allow overshooting traverse

This commit is contained in:
Leijurv 2019-05-04 15:01:11 -07:00
parent 2a5ef35794
commit 7dcd7384f1
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 12 additions and 3 deletions

View File

@ -215,6 +215,13 @@ public final class Settings {
*/
public final Setting<Boolean> sprintAscends = new Setting<>(true);
/**
* If we overshoot a traverse and end up one block beyond the destination, mark it as successful anyway.
* <p>
* This helps with speed at >=20m/s
*/
public final Setting<Boolean> overshootTraverse = new Setting<>(true);
/**
* When breaking blocks for a movement, wait until all falling blocks have settled before continuing
*/

View File

@ -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();