Interface PathStrategy

All Known Implementing Classes:
AbstractPathStrategy, AStarNavigationStrategy, FlyingAStarNavigationStrategy, MCNavigationStrategy, MCTargetStrategy, StraightLineNavigationStrategy

public interface PathStrategy
A pathfinding strategy directed at a target. Has two states: pathfinding -> cancelled represented by getCancelReason().
  • Method Details

    • clearCancelReason

      void clearCancelReason()
      Clears the CancelReason returned by getCancelReason() and attempts to resume pathfinding.
    • getCancelReason

      CancelReason getCancelReason()
      Returns:
      The reason for the pathfinding to stop, or null if it is still continuing.
    • getCurrentDestination

      Location getCurrentDestination()
      Returns:
      Gets the current movement destination
    • getPath

      Iterable<Vector> getPath()
      Returns:
      A copy of the current path, if any
    • getTargetAsLocation

      Location getTargetAsLocation()
      Returns:
      Gets the target destination location
    • getTargetType

      TargetType getTargetType()
      Returns:
      The TargetType of this strategy
    • stop

      void stop()
      Forcibly stops pathfinding. Note that this method does not necessarily set the cancel reason.
    • update

      boolean update()
      Updates and runs the pathfinding strategy on its current NPC and destination.
      Returns:
      Whether pathfinding has completed