Class WalkNodeEvaluator
java.lang.Object
net.minecraft.world.level.pathfinder.NodeEvaluator
net.minecraft.world.level.pathfinder.WalkNodeEvaluator
- Direct Known Subclasses:
AmphibiousNodeEvaluator
,FlyNodeEvaluator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.Object2BooleanMap
<AABB> private static final double
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap
<PathType> private final Node[]
static final double
Fields inherited from class net.minecraft.world.level.pathfinder.NodeEvaluator
canFloat, canOpenDoors, canPassDoors, canWalkOverFences, currentContext, entityDepth, entityHeight, entityWidth, mob, nodes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
canReachWithoutCollision
(Node node) protected boolean
canStartAt
(BlockPos pos) static PathType
checkNeighbourBlocks
(PathfindingContext context, int x, int y, int z, PathType pathType) private static boolean
doesBlockHavePartialCollision
(PathType pathType) void
done()
protected Node
findAcceptedNode
(int x, int y, int z, int verticalDeltaLimit, double nodeFloorLevel, Direction direction, PathType pathType) private Node
getBlockedNode
(int x, int y, int z) protected PathType
getCachedPathType
(int x, int y, int z) private Node
getClosedNode
(int x, int y, int z, PathType pathType) protected double
getFloorLevel
(BlockPos pos) static double
getFloorLevel
(BlockGetter level, BlockPos pos) private double
int
getNeighbors
(Node[] outputArray, Node p_node) private Node
getNodeAndUpdateCostToMax
(int x, int y, int z, PathType pathType, float malus) getPathType
(PathfindingContext context, int x, int y, int z) protected static PathType
getPathTypeFromState
(BlockGetter level, BlockPos pos) getPathTypeOfMob
(PathfindingContext context, int x, int y, int z, Mob mob) static PathType
getPathTypeStatic
(Mob mob, BlockPos pos) static PathType
getPathTypeStatic
(PathfindingContext context, BlockPos.MutableBlockPos pos) getPathTypeWithinMobBB
(PathfindingContext context, int x, int y, int z) getStart()
protected Node
getStartNode
(BlockPos pos) getTarget
(double x, double y, double z) private boolean
hasCollisions
(AABB boundingBox) protected boolean
protected boolean
isDiagonalValid
(Node node) protected boolean
isDiagonalValid
(Node root, Node xNode, Node zNode) protected boolean
isNeighborValid
(Node neighbor, Node node) void
prepare
(PathNavigationRegion level, Mob mob) private Node
tryFindFirstGroundNodeBelow
(int x, int y, int z) private Node
tryFindFirstNonWaterBelow
(int x, int y, int z, Node node) private Node
tryJumpOn
(int x, int y, int z, int verticalDeltaLimit, double nodeFloorLevel, Direction direction, PathType pathType, BlockPos.MutableBlockPos pos) Methods inherited from class net.minecraft.world.level.pathfinder.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:
done
in classNodeEvaluator
-
getStart
- Specified by:
getStart
in classNodeEvaluator
-
getStartNode
-
canStartAt
-
getTarget
- Specified by:
getTarget
in classNodeEvaluator
-
getNeighbors
- Specified by:
getNeighbors
in classNodeEvaluator
-
isNeighborValid
-
isDiagonalValid
-
isDiagonalValid
-
doesBlockHavePartialCollision
-
canReachWithoutCollision
-
getFloorLevel
-
getFloorLevel
-
isAmphibious
protected boolean isAmphibious() -
findAcceptedNode
-
getMobJumpHeight
private double getMobJumpHeight() -
getNodeAndUpdateCostToMax
-
getBlockedNode
-
getClosedNode
-
tryJumpOn
@Nullable private Node tryJumpOn(int x, int y, int z, int verticalDeltaLimit, double nodeFloorLevel, Direction direction, PathType pathType, BlockPos.MutableBlockPos pos) -
tryFindFirstNonWaterBelow
-
tryFindFirstGroundNodeBelow
-
hasCollisions
-
getCachedPathType
-
getPathTypeOfMob
- Specified by:
getPathTypeOfMob
in classNodeEvaluator
-
getPathTypeWithinMobBB
-
getPathType
- Specified by:
getPathType
in classNodeEvaluator
-
getPathTypeStatic
-
getPathTypeStatic
-
checkNeighbourBlocks
public static PathType checkNeighbourBlocks(PathfindingContext context, int x, int y, int z, PathType pathType) -
getPathTypeFromState