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 boolean
hasDelayedRecomputation
private boolean
isStuck
protected int
lastStuckCheck
protected Vector3d
lastStuckCheckPos
protected long
lastTimeoutCheck
protected World
level
protected float
maxDistanceToWaypoint
private float
maxVisitedNodesMultiplier
protected MobEntity
mob
protected NodeProcessor
nodeEvaluator
protected Path
path
private PathFinder
pathFinder
private int
reachRange
protected double
speedModifier
private BlockPos
targetPos
protected int
tick
protected long
timeLastRecompute
protected Vector3i
timeoutCachedNode
protected double
timeoutLimit
protected long
timeoutTimer
-
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 boolean
canFloat()
protected abstract boolean
canMoveDirectly(Vector3d p_75493_1_, Vector3d p_75493_2_, int p_75493_3_, int p_75493_4_, int p_75493_5_)
protected abstract boolean
canUpdatePath()
Path
createPath(double p_225466_1_, double p_225466_3_, double p_225466_5_, int p_225466_7_)
Path
createPath(java.util.Set<BlockPos> p_241390_1_, int p_241390_2_)
protected Path
createPath(java.util.Set<BlockPos> p_225464_1_, int p_225464_2_, boolean p_225464_3_, int p_225464_4_)
Path
createPath(java.util.stream.Stream<BlockPos> p_225463_1_, int p_225463_2_)
Path
createPath(Entity p_75494_1_, int p_75494_2_)
Path
createPath(BlockPos p_179680_1_, int p_179680_2_)
protected abstract PathFinder
createPathFinder(int p_179679_1_)
protected void
doStuckDetection(Vector3d p_179677_1_)
protected void
followThePath()
NodeProcessor
getNodeEvaluator()
Path
getPath()
BlockPos
getTargetPos()
protected abstract Vector3d
getTempMobPos()
boolean
hasDelayedRecomputation()
boolean
isDone()
protected boolean
isInLiquid()
boolean
isInProgress()
boolean
isStableDestination(BlockPos p_188555_1_)
boolean
isStuck()
boolean
moveTo(double p_75492_1_, double p_75492_3_, double p_75492_5_, double p_75492_7_)
boolean
moveTo(Entity p_75497_1_, double p_75497_2_)
boolean
moveTo(Path p_75484_1_, double p_75484_2_)
void
recomputePath()
void
recomputePath(BlockPos p_220970_1_)
void
resetMaxVisitedNodesMultiplier()
private void
resetStuckTimeout()
void
setCanFloat(boolean p_212239_1_)
void
setMaxVisitedNodesMultiplier(float p_226335_1_)
void
setSpeedModifier(double p_75489_1_)
private boolean
shouldTargetNextNodeInDirection(Vector3d p_234112_1_)
void
stop()
void
tick()
private void
timeoutPath()
protected void
trimPath()
-
-
-
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()
-
-