Class PathFinder
java.lang.Object
net.minecraft.world.level.pathfinder.PathFinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BooleanSupplierprivate static final floatprivate intprivate final Node[]private final NodeEvaluatorprivate final BinaryHeap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected floatprivate @Nullable PathfindPath(Node node, Map<Target, BlockPos> targets, float maxRange, int reachRange, float maxVisitedNodesMultiplier) Finds a path to one of the specified positions and post-processes it or returnsnullif no path could be found within given reach range@Nullable PathfindPath(PathNavigationRegion region, Mob mob, Set<BlockPos> targets, float maxRange, int reachRange, float maxVisitedNodesMultiplier) Finds a path to one of the specified positions and post-processes it or returnsnullif no path could be found within given reach rangeprivate floatprivate PathreconstructPath(Node node, BlockPos targetPos, boolean reachesTarget) Converts a recursive node structure into a pathvoidsetCaptureDebug(BooleanSupplier captureDebug) voidsetMaxVisitedNodes(int maxVisitedNodes)
-
Field Details
-
FUDGING
private static final float FUDGING- See Also:
-
neighbors
-
maxVisitedNodes
private int maxVisitedNodes -
nodeEvaluator
-
openSet
-
captureDebug
-
-
Constructor Details
-
PathFinder
-
-
Method Details
-
setCaptureDebug
-
setMaxVisitedNodes
public void setMaxVisitedNodes(int maxVisitedNodes) -
findPath
private @Nullable Path findPath(Node node, Map<Target, BlockPos> targets, float maxRange, int reachRange, float maxVisitedNodesMultiplier) Finds a path to one of the specified positions and post-processes it or returnsnullif no path could be found within given reach range -
distance
-
getBestH
-
reconstructPath
Converts a recursive node structure into a path
-