From 2aee91be102db254026d090413480947160a37d8 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 5 Nov 2018 16:46:24 -0800 Subject: [PATCH] fix it up a bit --- .../baritone/process/CustomGoalProcess.java | 3 --- .../utils/ExampleBaritoneControl.java | 20 +++++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/java/baritone/process/CustomGoalProcess.java b/src/main/java/baritone/process/CustomGoalProcess.java index 8b3d17733..98c700e37 100644 --- a/src/main/java/baritone/process/CustomGoalProcess.java +++ b/src/main/java/baritone/process/CustomGoalProcess.java @@ -57,9 +57,6 @@ public class CustomGoalProcess extends BaritoneProcessHelper implements ICustomG @Override public void path() { - if (this.goal == null) { - this.goal = baritone.getPathingBehavior().getGoal(); - } this.state = State.PATH_REQUESTED; } diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index 74c17d607..e908d1c49 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -100,7 +100,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { public boolean runCommand(String msg0) { String msg = msg0.toLowerCase(Locale.US).trim(); // don't reassign the argument LOL PathingBehavior pathingBehavior = baritone.getPathingBehavior(); - CustomGoalProcess CGPgrey = baritone.getCustomGoalProcess(); + CustomGoalProcess customGoalProcess = baritone.getCustomGoalProcess(); List> toggleable = Baritone.settings().getAllValuesByType(Boolean.class); for (Settings.Setting setting : toggleable) { if (msg.equalsIgnoreCase(setting.getName())) { @@ -188,7 +188,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { logDirect("unable to parse integer " + ex); return true; } - CGPgrey.setGoal(goal); + customGoalProcess.setGoal(goal); logDirect("Goal: " + goal); return true; } @@ -200,7 +200,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { } else if (pathingBehavior.isPathing()) { logDirect("Currently executing a path. Please cancel it first."); } else { - CGPgrey.path(); + customGoalProcess.setGoalAndPath(pathingBehavior.getGoal()); } return true; } @@ -222,7 +222,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { return true; } if (msg.equals("axis")) { - CGPgrey.setGoalAndPath(new GoalAxis()); + customGoalProcess.setGoalAndPath(new GoalAxis()); return true; } if (msg.equals("cancel") || msg.equals("stop")) { @@ -254,7 +254,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { logDirect("Inverting goal of player feet"); runAwayFrom = playerFeet(); } - CGPgrey.setGoalAndPath(new GoalRunAway(1, runAwayFrom) { + customGoalProcess.setGoalAndPath(new GoalRunAway(1, runAwayFrom) { @Override public boolean isInGoal(int x, int y, int z) { return false; @@ -329,7 +329,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { if (msg.startsWith("thisway")) { try { Goal goal = GoalXZ.fromDirection(playerFeetAsVec(), player().rotationYaw, Double.parseDouble(msg.substring(7).trim())); - CGPgrey.setGoal(goal); + customGoalProcess.setGoal(goal); logDirect("Goal: " + goal); } catch (NumberFormatException ex) { logDirect("Error unable to parse '" + msg.substring(7).trim() + "' to a double."); @@ -409,7 +409,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { } } Goal goal = new GoalBlock(waypoint.getLocation()); - CGPgrey.setGoalAndPath(goal); + customGoalProcess.setGoalAndPath(goal); return true; } if (msg.equals("spawn") || msg.equals("bed")) { @@ -419,10 +419,10 @@ public class ExampleBaritoneControl extends Behavior implements Helper { // for some reason the default spawnpoint is underground sometimes Goal goal = new GoalXZ(spawnPoint.getX(), spawnPoint.getZ()); logDirect("spawn not saved, defaulting to world spawn. set goal to " + goal); - CGPgrey.setGoalAndPath(goal); + customGoalProcess.setGoalAndPath(goal); } else { Goal goal = new GoalGetToBlock(waypoint.getLocation()); - CGPgrey.setGoalAndPath(goal); + customGoalProcess.setGoalAndPath(goal); logDirect("Set goal to most recent bed " + goal); } return true; @@ -438,7 +438,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { logDirect("home not saved"); } else { Goal goal = new GoalBlock(waypoint.getLocation()); - CGPgrey.setGoalAndPath(goal); + customGoalProcess.setGoalAndPath(goal); logDirect("Going to saved home " + goal); } return true;