From 34e5811613ab32ff437a0317cd22063bd05e37e3 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 24 Sep 2018 17:15:22 -0700 Subject: [PATCH] and a couple more --- src/main/java/baritone/utils/pathing/BetterBlockPos.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/pathing/BetterBlockPos.java b/src/main/java/baritone/utils/pathing/BetterBlockPos.java index 7763b64e..7aed17c6 100644 --- a/src/main/java/baritone/utils/pathing/BetterBlockPos.java +++ b/src/main/java/baritone/utils/pathing/BetterBlockPos.java @@ -106,7 +106,7 @@ public final class BetterBlockPos extends BlockPos { @Override public BetterBlockPos down(int amt) { // see comment in up() - return new BetterBlockPos(x, y - amt, z); + return amt == 0 ? this : new BetterBlockPos(x, y - amt, z); } @Override @@ -117,6 +117,9 @@ public final class BetterBlockPos extends BlockPos { @Override public BetterBlockPos offset(EnumFacing dir, int dist) { + if (dist == 0) { + return this; + } Vec3i vec = dir.getDirectionVec(); return new BetterBlockPos(x + vec.getX() * dist, y + vec.getY() * dist, z + vec.getZ() * dist); }