Interface Pathfinder.PathResult

Enclosing interface:
Pathfinder

public static interface Pathfinder.PathResult
Represents the result of a pathfinding calculation.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether the final point can be reached.
    Gets the closest point the path can get to the target location.
    Gets the next location in the path points the entity is trying to reach.
    int
    Gets the index of the current point along the points returned in getPoints() the entity is trying to reach.
    All currently calculated points to follow along the path to reach the destination location.
  • Method Details

    • getPoints

      List<Location> getPoints()
      All currently calculated points to follow along the path to reach the destination location.

      Will return points the entity has already moved past, see getNextPointIndex()

      Returns:
      List of points
    • getNextPointIndex

      int getNextPointIndex()
      Gets the index of the current point along the points returned in getPoints() the entity is trying to reach. This value will be higher than the maximum index of getPoints() if this path finding is done.
      Returns:
      the index of the next point
    • getNextPoint

      @Nullable Location getNextPoint()
      Gets the next location in the path points the entity is trying to reach.
      Returns:
      The next location in the path points the entity is trying to reach, or null if there is no next point
    • getFinalPoint

      @Nullable Location getFinalPoint()
      Gets the closest point the path can get to the target location.
      Returns:
      The closest point the path can get to the target location
    • canReachFinalPoint

      boolean canReachFinalPoint()
      Checks whether the final point can be reached.
      Returns:
      whether the final point can be reached
      See Also: