Class PathFinder

java.lang.Object
net.minecraft.world.level.pathfinder.PathFinder

public class PathFinder extends Object
  • Field Details

    • FUDGING

      private static final float FUDGING
      See Also:
    • neighbors

      private final Node[] neighbors
    • maxVisitedNodes

      private final int maxVisitedNodes
    • nodeEvaluator

      private final NodeEvaluator nodeEvaluator
    • DEBUG

      private static final boolean DEBUG
      See Also:
    • openSet

      private final BinaryHeap openSet
  • Constructor Details

    • PathFinder

      public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes)
  • Method Details

    • findPath

      @Nullable public Path findPath(PathNavigationRegion region, Mob mob, Set<BlockPos> targetPositions, float maxRange, int accuracy, float searchDepthMultiplier)
      Finds a path to one of the specified positions and post-processes it or returns null if no path could be found within given accuracy
    • findPath

      @Nullable private Path findPath(ProfilerFiller profiler, Node p_node, Map<Target,BlockPos> targetPos, float maxRange, int accuracy, float searchDepthMultiplier)
    • distance

      protected float distance(Node first, Node second)
    • getBestH

      private float getBestH(Node node, Set<Target> targets)
    • reconstructPath

      private Path reconstructPath(Node point, BlockPos targetPos, boolean reachesTarget)
      Converts a recursive path point structure into a path