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 pNodeEvaluator, int pMaxVisitedNodes)
  • Method Details

    • findPath

      @Nullable public Path findPath(PathNavigationRegion pRegion, Mob pMob, Set<BlockPos> pTargetPositions, float pMaxRange, int pAccuracy, float pSearchDepthMultiplier)
      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 pProfiler, Node pNode, Map<Target,BlockPos> pTargetPos, float pMaxRange, int pAccuracy, float pSearchDepthMultiplier)
    • distance

      protected float distance(Node pFirst, Node pSecond)
    • getBestH

      private float getBestH(Node pNode, Set<Target> pTargets)
    • reconstructPath

      private Path reconstructPath(Node pPoint, BlockPos pTargetPos, boolean pReachesTarget)
      Converts a recursive path point structure into a path