don't allocate for up(0)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user