don't allocate for up(0)

This commit is contained in:
Leijurv
2018-08-14 11:25:30 -07:00
parent 86f1f472f5
commit 3a68009194
8 changed files with 12 additions and 31 deletions

View File

@@ -88,7 +88,6 @@ public abstract class AbstractNodeCostSearch implements IPathFinder {
*
* @param n A node
* @return The distance, squared
* @see AbstractNodeCostSearch#getDistFromStart(PathNode)
*/
protected double getDistFromStartSq(PathNode n) {
int xDiff = n.pos.getX() - start.getX();
@@ -97,16 +96,6 @@ public abstract class AbstractNodeCostSearch implements IPathFinder {
return xDiff * xDiff + yDiff * yDiff + zDiff * zDiff;
}
/**
* Determines the distance from the specified node to this the node.
*
* @param n A node
* @return The distance
*/
protected double getDistFromStart(PathNode n) {
return Math.sqrt(getDistFromStartSq(n));
}
/**
* Attempts to search the {@link BlockPos} to {@link PathNode} map
* for the node mapped to the specified pos. If no node is found,