Class PathNavigation
java.lang.Object
net.minecraft.world.entity.ai.navigation.PathNavigation
- Direct Known Subclasses:
AmphibiousPathNavigation, FlyingPathNavigation, GroundPathNavigation, WaterBoundPathNavigation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate booleanprotected intprotected Vec3protected longprotected final Levelprivate static final intprotected floatprivate floatprotected final Mobprotected NodeEvaluatorprotected @Nullable Pathprivate final PathFinderprivate intprivate floatprotected doubleprivate static final intprivate static final floatprivate @Nullable BlockPosprotected intprotected longprotected Vec3iprotected doubleprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCutCorner(PathType pathType) booleancanFloat()protected booleancanMoveDirectly(Vec3 startPos, Vec3 stopPos) abstract booleanprotected abstract booleanfinal @Nullable PathcreatePath(double x, double y, double z, int reachRange) @Nullable PathcreatePath(Set<BlockPos> positions, int reachRange) protected @Nullable PathcreatePath(Set<BlockPos> targets, int radiusOffset, boolean above, int reachRange) protected @Nullable PathcreatePath(Set<BlockPos> targets, int radiusOffset, boolean above, int reachRange, float maxPathLength) @Nullable PathcreatePath(Stream<BlockPos> positions, int reachRange) @Nullable PathcreatePath(BlockPos pos, int reachRange) @Nullable PathcreatePath(BlockPos pos, int reachRange, int maxPathLength) @Nullable PathcreatePath(Entity target, int reachRange) protected abstract PathFindercreatePathFinder(int maxVisitedNodes) protected voiddoStuckDetection(Vec3 mobPos) protected voidprotected doublegetGroundY(Vec3 target) floatprivate float@Nullable PathgetPath()@Nullable BlockPosprotected abstract Vec3protected static booleanisClearForMovementBetween(Mob mob, Vec3 startPos, Vec3 stopPos, boolean blockedByFluids) booleanisDone()booleanbooleanbooleanisStuck()booleanmoveTo(double x, double y, double z, double speedModifier) booleanmoveTo(double x, double y, double z, int reachRange, double speedModifier) booleanbooleanvoidvoidprivate voidvoidsetCanFloat(boolean canFloat) voidsetCanOpenDoors(boolean canOpenDoors) voidsetMaxVisitedNodesMultiplier(float maxVisitedNodesMultiplier) voidsetRequiredPathLength(float length) voidsetSpeedModifier(double speedModifier) booleanprivate booleanshouldTargetNextNodeInDirection(Vec3 mobPosition) voidstop()voidtick()private voidprotected voidtrimPath()void
-
Field Details
-
MAX_TIME_RECOMPUTE
private static final int MAX_TIME_RECOMPUTE- See Also:
-
STUCK_CHECK_INTERVAL
private static final int STUCK_CHECK_INTERVAL- See Also:
-
STUCK_THRESHOLD_DISTANCE_FACTOR
private static final float STUCK_THRESHOLD_DISTANCE_FACTOR- See Also:
-
mob
-
level
-
path
-
speedModifier
protected double speedModifier -
tick
protected int tick -
lastStuckCheck
protected int lastStuckCheck -
lastStuckCheckPos
-
timeoutCachedNode
-
timeoutTimer
protected long timeoutTimer -
lastTimeoutCheck
protected long lastTimeoutCheck -
timeoutLimit
protected double timeoutLimit -
maxDistanceToWaypoint
protected float maxDistanceToWaypoint -
hasDelayedRecomputation
protected boolean hasDelayedRecomputation -
timeLastRecompute
protected long timeLastRecompute -
nodeEvaluator
-
targetPos
-
reachRange
private int reachRange -
maxVisitedNodesMultiplier
private float maxVisitedNodesMultiplier -
pathFinder
-
isStuck
private boolean isStuck -
requiredPathLength
private float requiredPathLength
-
-
Constructor Details
-
PathNavigation
-
-
Method Details
-
updatePathfinderMaxVisitedNodes
public void updatePathfinderMaxVisitedNodes() -
setRequiredPathLength
public void setRequiredPathLength(float length) -
getMaxPathLength
private float getMaxPathLength() -
resetMaxVisitedNodesMultiplier
public void resetMaxVisitedNodesMultiplier() -
setMaxVisitedNodesMultiplier
public void setMaxVisitedNodesMultiplier(float maxVisitedNodesMultiplier) -
getTargetPos
-
createPathFinder
-
setSpeedModifier
public void setSpeedModifier(double speedModifier) -
recomputePath
public void recomputePath() -
createPath
-
createPath
-
createPath
-
createPath
-
createPath
-
createPath
-
createPath
-
createPath
-
moveTo
public boolean moveTo(double x, double y, double z, double speedModifier) -
moveTo
public boolean moveTo(double x, double y, double z, int reachRange, double speedModifier) -
moveTo
-
moveTo
-
getPath
-
tick
public void tick() -
getGroundY
-
followThePath
protected void followThePath() -
shouldTargetNextNodeInDirection
-
doStuckDetection
-
timeoutPath
private void timeoutPath() -
resetStuckTimeout
private void resetStuckTimeout() -
isDone
public boolean isDone() -
isInProgress
public boolean isInProgress() -
stop
public void stop() -
getTempMobPos
-
canUpdatePath
protected abstract boolean canUpdatePath() -
trimPath
protected void trimPath() -
canMoveDirectly
-
canCutCorner
-
isClearForMovementBetween
-
isStableDestination
-
getNodeEvaluator
-
setCanFloat
public void setCanFloat(boolean canFloat) -
canFloat
public boolean canFloat() -
shouldRecomputePath
-
getMaxDistanceToWaypoint
public float getMaxDistanceToWaypoint() -
isStuck
public boolean isStuck() -
setCanOpenDoors
public void setCanOpenDoors(boolean canOpenDoors)
-