Class WalkNodeEvaluator
java.lang.Object
net.minecraft.world.level.pathfinder.NodeEvaluator
net.minecraft.world.level.pathfinder.WalkNodeEvaluator
- Direct Known Subclasses:
AmphibiousNodeEvaluator, Creaking.HomeNodeEvaluator, FlyNodeEvaluator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.Object2BooleanMap<AABB> private static final doubleprivate final it.unimi.dsi.fastutil.longs.Long2ObjectMap<PathType> private final Node[]static final doubleFields inherited from class NodeEvaluator
canFloat, canOpenDoors, canPassDoors, canWalkOverFences, currentContext, entityDepth, entityHeight, entityWidth, mob, nodes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleancanReachWithoutCollision(Node posTo) protected booleancanStartAt(BlockPos pos) static PathTypecheckNeighbourBlocks(PathfindingContext context, int x, int y, int z, PathType blockPathType) private static booleanvoiddone()protected @Nullable NodefindAcceptedNode(int x, int y, int z, int jumpSize, double nodeHeight, Direction travelDirection, PathType blockPathTypeCurrent) private NodegetBlockedNode(int x, int y, int z) protected PathTypegetCachedPathType(int x, int y, int z) private NodegetClosedNode(int x, int y, int z, PathType pathType) protected doublegetFloorLevel(BlockPos pos) static doublegetFloorLevel(BlockGetter level, BlockPos pos) private doubleintgetNeighbors(Node[] neighbors, Node pos) private NodegetNodeAndUpdateCostToMax(int x, int y, int z, PathType pathType, float cost) getPathType(PathfindingContext context, int x, int y, int z) protected static PathTypegetPathTypeFromState(BlockGetter level, BlockPos pos) getPathTypeOfMob(PathfindingContext context, int x, int y, int z, Mob mob) static PathTypegetPathTypeStatic(Mob mob, BlockPos pos) static PathTypegetPathTypeStatic(PathfindingContext context, BlockPos.MutableBlockPos pos) getPathTypeWithinMobBB(PathfindingContext context, int x, int y, int z) getStart()protected NodegetStartNode(BlockPos pos) getTarget(double x, double y, double z) private booleanhasCollisions(AABB aabb) protected booleanprotected booleanisDiagonalValid(@Nullable Node diagonal) protected booleanisDiagonalValid(Node pos, @Nullable Node ew, @Nullable Node ns) protected booleanisNeighborValid(@Nullable Node neighbor, Node current) voidprepare(PathNavigationRegion level, Mob entity) private NodetryFindFirstGroundNodeBelow(int x, int y, int z) private @Nullable NodetryFindFirstNonWaterBelow(int x, int y, int z, @Nullable Node best) private @Nullable NodetryJumpOn(int x, int y, int z, int jumpSize, double nodeHeight, Direction travelDirection, PathType blockPathTypeCurrent, BlockPos.MutableBlockPos reusablePos) Methods inherited from class NodeEvaluator
canFloat, canOpenDoors, canPassDoors, canWalkOverFences, getNode, getNode, getPathType, getTargetNodeAt, isBurningBlock, setCanFloat, setCanOpenDoors, setCanPassDoors, setCanWalkOverFences
-
Field Details
-
SPACE_BETWEEN_WALL_POSTS
public static final double SPACE_BETWEEN_WALL_POSTS- See Also:
-
DEFAULT_MOB_JUMP_HEIGHT
private static final double DEFAULT_MOB_JUMP_HEIGHT- See Also:
-
pathTypesByPosCacheByMob
-
collisionCache
-
reusableNeighbors
-
-
Constructor Details
-
WalkNodeEvaluator
public WalkNodeEvaluator()
-
-
Method Details
-
done
public void done()- Overrides:
donein classNodeEvaluator
-
getStart
- Specified by:
getStartin classNodeEvaluator
-
getStartNode
-
canStartAt
-
getTarget
- Specified by:
getTargetin classNodeEvaluator
-
getNeighbors
- Specified by:
getNeighborsin classNodeEvaluator
-
isNeighborValid
-
isDiagonalValid
-
isDiagonalValid
-
doesBlockHavePartialCollision
-
canReachWithoutCollision
-
getFloorLevel
-
getFloorLevel
-
isAmphibious
protected boolean isAmphibious() -
findAcceptedNode
-
getMobJumpHeight
private double getMobJumpHeight() -
getNodeAndUpdateCostToMax
-
getBlockedNode
-
getClosedNode
-
tryJumpOn
private @Nullable Node tryJumpOn(int x, int y, int z, int jumpSize, double nodeHeight, Direction travelDirection, PathType blockPathTypeCurrent, BlockPos.MutableBlockPos reusablePos) -
tryFindFirstNonWaterBelow
-
tryFindFirstGroundNodeBelow
-
hasCollisions
-
getCachedPathType
-
getPathTypeOfMob
- Specified by:
getPathTypeOfMobin classNodeEvaluator
-
getPathTypeWithinMobBB
-
getPathType
- Specified by:
getPathTypein classNodeEvaluator
-
getPathTypeStatic
-
getPathTypeStatic
-
checkNeighbourBlocks
public static PathType checkNeighbourBlocks(PathfindingContext context, int x, int y, int z, PathType blockPathType) -
getPathTypeFromState