From 6861bfd4e667c9c23a8849e3efc42049fa6b6205 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 16 May 2019 11:50:48 -0700 Subject: [PATCH] relative goals --- .../baritone/api/utils/ExampleBaritoneControl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java index 715d8edba..67cd5b472 100644 --- a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java +++ b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java @@ -688,18 +688,20 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener private Goal parseGoal(String[] params) { Goal goal; try { + BetterBlockPos playerFeet = ctx.playerFeet(); switch (params.length) { case 0: - goal = new GoalBlock(ctx.playerFeet()); + goal = new GoalBlock(playerFeet); break; case 1: - goal = new GoalYLevel(Integer.parseInt(params[0])); + + goal = new GoalYLevel(parseOrDefault(params[0], playerFeet.y)); break; case 2: - goal = new GoalXZ(Integer.parseInt(params[0]), Integer.parseInt(params[1])); + goal = new GoalXZ(parseOrDefault(params[0], playerFeet.x), parseOrDefault(params[1], playerFeet.z)); break; case 3: - goal = new GoalBlock(new BlockPos(Integer.parseInt(params[0]), Integer.parseInt(params[1]), Integer.parseInt(params[2]))); + goal = new GoalBlock(new BlockPos(parseOrDefault(params[0], playerFeet.x), parseOrDefault(params[1], playerFeet.y), parseOrDefault(params[2], playerFeet.z))); break; default: logDirect("unable to understand lol");