From ce39183482f7f37ea878c4a880081ed28b05064b Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 24 Sep 2018 19:03:19 -0500 Subject: [PATCH] Add more fast methods to BetterBlockPos --- .../utils/pathing/BetterBlockPos.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/java/baritone/utils/pathing/BetterBlockPos.java b/src/main/java/baritone/utils/pathing/BetterBlockPos.java index eb85e6bf..7763b64e 100644 --- a/src/main/java/baritone/utils/pathing/BetterBlockPos.java +++ b/src/main/java/baritone/utils/pathing/BetterBlockPos.java @@ -126,18 +126,38 @@ public final class BetterBlockPos extends BlockPos { return new BetterBlockPos(x, y, z - 1); } + @Override + public BetterBlockPos north(int amt) { + return amt == 0 ? this : new BetterBlockPos(x, y, z - amt); + } + @Override public BetterBlockPos south() { return new BetterBlockPos(x, y, z + 1); } + @Override + public BetterBlockPos south(int amt) { + return amt == 0 ? this : new BetterBlockPos(x, y, z + amt); + } + @Override public BetterBlockPos east() { return new BetterBlockPos(x + 1, y, z); } + @Override + public BetterBlockPos east(int amt) { + return amt == 0 ? this : new BetterBlockPos(x + amt, y, z); + } + @Override public BetterBlockPos west() { return new BetterBlockPos(x - 1, y, z); } + + @Override + public BetterBlockPos west(int amt) { + return amt == 0 ? this : new BetterBlockPos(x - amt, y, z); + } }