Interface PathfinderHook


public interface PathfinderHook
Interface for hooks that are called during the pathfinding process.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called once before the pathfinding loop begins, after the start node has been initialized but before any node is expanded.
    void
    Called on each step of the pathfinding process.
  • Method Details

    • onPathfindingStep

      void onPathfindingStep(PathfindingContext pathfindingContext)
      Called on each step of the pathfinding process.
      Parameters:
      pathfindingContext - the context of the current pathfinding step
    • onPathfindingStart

      default void onPathfindingStart(PathfindingContext pathfindingContext)
      Called once before the pathfinding loop begins, after the start node has been initialized but before any node is expanded. Useful for one-time setup or for recording the search origin.

      The supplied context carries the start position as its current position, a depth of zero, and the search-wide PathfindingContext.target() and PathfindingContext.environmentContext(). The default implementation does nothing, so existing hooks remain source- and binary-compatible.

      Parameters:
      pathfindingContext - the context describing the start of the pathfinding process