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 pNode) protected boolean
canStartAt
(BlockPos pPos) static PathType
checkNeighbourBlocks
(PathfindingContext pContext, int pX, int pY, int pZ, PathType pPathType) private static boolean
doesBlockHavePartialCollision
(PathType pPathType) void
done()
protected Node
findAcceptedNode
(int pX, int pY, int pZ, int pVerticalDeltaLimit, double pNodeFloorLevel, Direction pDirection, PathType pPathType) private Node
getBlockedNode
(int pX, int pY, int pZ) protected PathType
getCachedPathType
(int pX, int pY, int pZ) private Node
getClosedNode
(int pX, int pY, int pZ, PathType pPathType) protected double
getFloorLevel
(BlockPos pPos) static double
getFloorLevel
(BlockGetter pLevel, BlockPos pPos) private double
int
getNeighbors
(Node[] pOutputArray, Node pNode) private Node
getNodeAndUpdateCostToMax
(int pX, int pY, int pZ, PathType pPathType, float pMalus) getPathType
(PathfindingContext pContext, int pX, int pY, int pZ) protected static PathType
getPathTypeFromState
(BlockGetter pLevel, BlockPos pPos) getPathTypeOfMob
(PathfindingContext pContext, int pX, int pY, int pZ, Mob pMob) static PathType
getPathTypeStatic
(Mob pMob, BlockPos pPos) static PathType
getPathTypeStatic
(PathfindingContext pContext, BlockPos.MutableBlockPos pPos) getPathTypeWithinMobBB
(PathfindingContext pContext, int pX, int pY, int pZ) getStart()
protected Node
getStartNode
(BlockPos pPos) getTarget
(double pX, double pY, double pZ) private boolean
hasCollisions
(AABB pBoundingBox) protected boolean
protected boolean
isDiagonalValid
(Node pNode) protected boolean
isDiagonalValid
(Node pRoot, Node pXNode, Node pZNode) protected boolean
isNeighborValid
(Node pNeighbor, Node pNode) void
prepare
(PathNavigationRegion pLevel, Mob pMob) private Node
tryFindFirstGroundNodeBelow
(int pX, int pY, int pZ) private Node
tryFindFirstNonWaterBelow
(int pX, int pY, int pZ, Node pNode) private Node
tryJumpOn
(int pX, int pY, int pZ, int pVerticalDeltaLimit, double pNodeFloorLevel, Direction pDirection, PathType pPathType, BlockPos.MutableBlockPos pPos) 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 pX, int pY, int pZ, int pVerticalDeltaLimit, double pNodeFloorLevel, Direction pDirection, PathType pPathType, BlockPos.MutableBlockPos pPos) -
tryFindFirstNonWaterBelow
-
tryFindFirstGroundNodeBelow
-
hasCollisions
-
getCachedPathType
-
getPathTypeOfMob
- Specified by:
getPathTypeOfMob
in classNodeEvaluator
-
getPathTypeWithinMobBB
-
getPathType
- Specified by:
getPathType
in classNodeEvaluator
-
getPathTypeStatic
-
getPathTypeStatic
public static PathType getPathTypeStatic(PathfindingContext pContext, BlockPos.MutableBlockPos pPos) -
checkNeighbourBlocks
public static PathType checkNeighbourBlocks(PathfindingContext pContext, int pX, int pY, int pZ, PathType pPathType) -
getPathTypeFromState