properly set isSafeToCancel in MovementDiagonal, fixes #1788

This commit is contained in:
Leijurv 2020-08-17 16:15:56 -07:00
parent 9851623557
commit 02e7886e77
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -56,6 +56,14 @@ public class MovementDiagonal extends Movement {
super(baritone, start, end, new BetterBlockPos[]{dir1, dir1.up(), dir2, dir2.up(), end, end.up()});
}
@Override
protected boolean safeToCancel(MovementState state) {
return ctx.playerFeet().equals(src) || ((
MovementHelper.canWalkOn(ctx, new BlockPos(src.x, src.y - 1, dest.z))
) &&
MovementHelper.canWalkOn(ctx, new BlockPos(dest.x, src.y - 1, src.z)));
}
@Override
public double calculateCost(CalculationContext context) {
MutableMoveResult result = new MutableMoveResult();