diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 0d88dbe1..066a47d4 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -420,7 +420,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, } CalculationContext context = new CalculationContext(baritone, true); // not safe to create on the other thread, it looks up a lot of stuff in minecraft AbstractNodeCostSearch pathfinder = createPathfinder(start, goal, current == null ? null : current.getPath(), context); - if (!Objects.equals(pathfinder.getGoal(), goal)) { + if (!Objects.equals(pathfinder.getGoal(), goal)) { // will return the exact same object if simplification didn't happen logDebug("Simplifying " + goal.getClass() + " to GoalXZ due to distance"); } inProgress = pathfinder; diff --git a/src/main/java/baritone/pathing/path/SplicedPath.java b/src/main/java/baritone/pathing/path/SplicedPath.java index f2187fe7..b3c497fd 100644 --- a/src/main/java/baritone/pathing/path/SplicedPath.java +++ b/src/main/java/baritone/pathing/path/SplicedPath.java @@ -71,7 +71,7 @@ public class SplicedPath extends PathBase { if (second == null || first == null) { return Optional.empty(); } - if (!Objects.equals(first.getGoal(), second.getGoal())) { + if (!first.getGoal().toString().equals(second.getGoal().toString())) { return Optional.empty(); } if (!first.getDest().equals(second.getSrc())) { diff --git a/src/main/java/baritone/process/CustomGoalProcess.java b/src/main/java/baritone/process/CustomGoalProcess.java index 65f0ba7a..a07e4aa4 100644 --- a/src/main/java/baritone/process/CustomGoalProcess.java +++ b/src/main/java/baritone/process/CustomGoalProcess.java @@ -74,7 +74,7 @@ public class CustomGoalProcess extends BaritoneProcessHelper implements ICustomG public PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel) { switch (this.state) { case GOAL_SET: - if (!baritone.getPathingBehavior().isPathing() && Objects.equals(baritone.getPathingBehavior().getGoal(), this.goal)) { + if (!baritone.getPathingBehavior().isPathing() && Objects.equals(baritone.getPathingBehavior().getGoal() + "", this.goal + "")) { this.state = State.NONE; } return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL); diff --git a/src/main/java/baritone/utils/pathing/PathBase.java b/src/main/java/baritone/utils/pathing/PathBase.java index 129e0735..89f80207 100644 --- a/src/main/java/baritone/utils/pathing/PathBase.java +++ b/src/main/java/baritone/utils/pathing/PathBase.java @@ -39,15 +39,14 @@ public abstract class PathBase implements IPath { @Override public PathBase staticCutoff(Goal destination) { - int min = BaritoneAPI.getSettings().pathCutoffMinimumLength.get(); - if (length() < min) { + if (length() < BaritoneAPI.getSettings().pathCutoffMinimumLength.get()) { return this; } if (destination == null || destination.isInGoal(getDest())) { return this; } double factor = BaritoneAPI.getSettings().pathCutoffFactor.get(); - int newLength = (int) ((length() - 1 - min) * factor) + min; + int newLength = (int) ((length() - 1) * factor); return new CutoffPath(this, newLength); } }