Package net.minecraft.pathfinding
Class PathNavigator
- java.lang.Object
-
- net.minecraft.pathfinding.PathNavigator
-
- Direct Known Subclasses:
FlyingPathNavigator,GroundPathNavigator,SwimmerPathNavigator
public abstract class PathNavigator extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanhasDelayedRecomputationprivate booleanisStuckprotected intlastStuckCheckprotected Vector3dlastStuckCheckPosprotected longlastTimeoutCheckprotected Worldlevelprotected floatmaxDistanceToWaypointprivate floatmaxVisitedNodesMultiplierprotected MobEntitymobprotected NodeProcessornodeEvaluatorprotected Pathpathprivate PathFinderpathFinderprivate intreachRangeprotected doublespeedModifierprivate BlockPostargetPosprotected inttickprotected longtimeLastRecomputeprotected Vector3itimeoutCachedNodeprotected doubletimeoutLimitprotected longtimeoutTimer
-
Constructor Summary
Constructors Constructor Description PathNavigator(MobEntity p_i1671_1_, World p_i1671_2_)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanFloat()protected abstract booleancanMoveDirectly(Vector3d p_75493_1_, Vector3d p_75493_2_, int p_75493_3_, int p_75493_4_, int p_75493_5_)protected abstract booleancanUpdatePath()PathcreatePath(double p_225466_1_, double p_225466_3_, double p_225466_5_, int p_225466_7_)PathcreatePath(java.util.Set<BlockPos> p_241390_1_, int p_241390_2_)protected PathcreatePath(java.util.Set<BlockPos> p_225464_1_, int p_225464_2_, boolean p_225464_3_, int p_225464_4_)PathcreatePath(java.util.stream.Stream<BlockPos> p_225463_1_, int p_225463_2_)PathcreatePath(Entity p_75494_1_, int p_75494_2_)PathcreatePath(BlockPos p_179680_1_, int p_179680_2_)protected abstract PathFindercreatePathFinder(int p_179679_1_)protected voiddoStuckDetection(Vector3d p_179677_1_)protected voidfollowThePath()NodeProcessorgetNodeEvaluator()PathgetPath()BlockPosgetTargetPos()protected abstract Vector3dgetTempMobPos()booleanhasDelayedRecomputation()booleanisDone()protected booleanisInLiquid()booleanisInProgress()booleanisStableDestination(BlockPos p_188555_1_)booleanisStuck()booleanmoveTo(double p_75492_1_, double p_75492_3_, double p_75492_5_, double p_75492_7_)booleanmoveTo(Entity p_75497_1_, double p_75497_2_)booleanmoveTo(Path p_75484_1_, double p_75484_2_)voidrecomputePath()voidrecomputePath(BlockPos p_220970_1_)voidresetMaxVisitedNodesMultiplier()private voidresetStuckTimeout()voidsetCanFloat(boolean p_212239_1_)voidsetMaxVisitedNodesMultiplier(float p_226335_1_)voidsetSpeedModifier(double p_75489_1_)private booleanshouldTargetNextNodeInDirection(Vector3d p_234112_1_)voidstop()voidtick()private voidtimeoutPath()protected voidtrimPath()
-
-
-
Field Detail
-
mob
protected final MobEntity mob
-
level
protected final World level
-
path
@Nullable protected Path path
-
speedModifier
protected double speedModifier
-
tick
protected int tick
-
lastStuckCheck
protected int lastStuckCheck
-
lastStuckCheckPos
protected Vector3d lastStuckCheckPos
-
timeoutCachedNode
protected Vector3i 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
protected NodeProcessor nodeEvaluator
-
targetPos
private BlockPos targetPos
-
reachRange
private int reachRange
-
maxVisitedNodesMultiplier
private float maxVisitedNodesMultiplier
-
pathFinder
private final PathFinder pathFinder
-
isStuck
private boolean isStuck
-
-
Method Detail
-
resetMaxVisitedNodesMultiplier
public void resetMaxVisitedNodesMultiplier()
-
setMaxVisitedNodesMultiplier
public void setMaxVisitedNodesMultiplier(float p_226335_1_)
-
getTargetPos
public BlockPos getTargetPos()
-
createPathFinder
protected abstract PathFinder createPathFinder(int p_179679_1_)
-
setSpeedModifier
public void setSpeedModifier(double p_75489_1_)
-
hasDelayedRecomputation
public boolean hasDelayedRecomputation()
-
recomputePath
public void recomputePath()
-
createPath
@Nullable public final Path createPath(double p_225466_1_, double p_225466_3_, double p_225466_5_, int p_225466_7_)
-
createPath
@Nullable public Path createPath(java.util.stream.Stream<BlockPos> p_225463_1_, int p_225463_2_)
-
createPath
@Nullable protected Path createPath(java.util.Set<BlockPos> p_225464_1_, int p_225464_2_, boolean p_225464_3_, int p_225464_4_)
-
moveTo
public boolean moveTo(double p_75492_1_, double p_75492_3_, double p_75492_5_, double p_75492_7_)
-
moveTo
public boolean moveTo(Entity p_75497_1_, double p_75497_2_)
-
moveTo
public boolean moveTo(@Nullable Path p_75484_1_, double p_75484_2_)
-
getPath
@Nullable public Path getPath()
-
tick
public void tick()
-
followThePath
protected void followThePath()
-
shouldTargetNextNodeInDirection
private boolean shouldTargetNextNodeInDirection(Vector3d p_234112_1_)
-
doStuckDetection
protected void doStuckDetection(Vector3d p_179677_1_)
-
timeoutPath
private void timeoutPath()
-
resetStuckTimeout
private void resetStuckTimeout()
-
isDone
public boolean isDone()
-
isInProgress
public boolean isInProgress()
-
stop
public void stop()
-
getTempMobPos
protected abstract Vector3d getTempMobPos()
-
canUpdatePath
protected abstract boolean canUpdatePath()
-
isInLiquid
protected boolean isInLiquid()
-
trimPath
protected void trimPath()
-
canMoveDirectly
protected abstract boolean canMoveDirectly(Vector3d p_75493_1_, Vector3d p_75493_2_, int p_75493_3_, int p_75493_4_, int p_75493_5_)
-
isStableDestination
public boolean isStableDestination(BlockPos p_188555_1_)
-
getNodeEvaluator
public NodeProcessor getNodeEvaluator()
-
setCanFloat
public void setCanFloat(boolean p_212239_1_)
-
canFloat
public boolean canFloat()
-
recomputePath
public void recomputePath(BlockPos p_220970_1_)
-
isStuck
public boolean isStuck()
-
-