From 2e7f5048dca3901ce845a6d38d763b2c5461722b Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 14 Aug 2018 10:50:41 -0700 Subject: [PATCH] this is so sad --- .../java/baritone/bot/pathing/calc/AStarPathFinder.java | 4 ++-- .../bot/pathing/calc/AbstractNodeCostSearch.java | 4 ++-- src/main/java/baritone/bot/pathing/calc/Path.java | 9 +-------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java b/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java index 552aeb4b..93025a53 100644 --- a/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java +++ b/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java @@ -105,7 +105,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper { } if (goal.isInGoal(currentNodePos)) { currentlyRunning = null; - return Optional.of(new Path(startNode, currentNode, goal, numNodes)); + return Optional.of(new Path(startNode, currentNode, numNodes)); } //long constructStart = System.nanoTime(); Movement[] possibleMovements = getConnectedPositions(currentNodePos, calcContext);//movement that we could take that start at myPos, in random order @@ -184,7 +184,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper { } System.out.println("Path goes for " + dist + " blocks"); currentlyRunning = null; - return Optional.of(new Path(startNode, bestSoFar[i], goal, numNodes)); + return Optional.of(new Path(startNode, bestSoFar[i], numNodes)); } } displayChatMessageRaw("Even with a cost coefficient of " + COEFFICIENTS[COEFFICIENTS.length - 1] + ", I couldn't get more than " + bestDist + " blocks =("); diff --git a/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java b/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java index 50a624bc..b6d9c293 100644 --- a/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java +++ b/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java @@ -121,7 +121,7 @@ public abstract class AbstractNodeCostSearch implements IPathFinder { @Override public Optional pathToMostRecentNodeConsidered() { - return Optional.ofNullable(mostRecentConsidered).map(node -> new Path(startNode, node, goal, 0)); + return Optional.ofNullable(mostRecentConsidered).map(node -> new Path(startNode, node, 0)); } @Override @@ -129,7 +129,7 @@ public abstract class AbstractNodeCostSearch implements IPathFinder { if (startNode == null || bestSoFar[0] == null) return Optional.empty(); - return Optional.of(new Path(startNode, bestSoFar[0], goal, 0)); + return Optional.of(new Path(startNode, bestSoFar[0], 0)); } @Override diff --git a/src/main/java/baritone/bot/pathing/calc/Path.java b/src/main/java/baritone/bot/pathing/calc/Path.java index 77a1af83..982885a1 100644 --- a/src/main/java/baritone/bot/pathing/calc/Path.java +++ b/src/main/java/baritone/bot/pathing/calc/Path.java @@ -17,7 +17,6 @@ package baritone.bot.pathing.calc; -import baritone.bot.pathing.goals.Goal; import baritone.bot.pathing.movement.Movement; import baritone.bot.pathing.path.IPath; import net.minecraft.util.math.BlockPos; @@ -44,11 +43,6 @@ class Path implements IPath { */ final BlockPos end; - /** - * The goal that this path is attempting to accomplish - */ - final Goal goal; - /** * The blocks on the path. Guaranteed that path.get(0) equals start and * path.get(path.size()-1) equals end @@ -59,10 +53,9 @@ class Path implements IPath { private final int numNodes; - Path(PathNode start, PathNode end, Goal goal, int numNodes) { + Path(PathNode start, PathNode end, int numNodes) { this.start = start.pos; this.end = end.pos; - this.goal = goal; this.numNodes = numNodes; this.path = new ArrayList<>(); this.movements = new ArrayList<>();