public abstract class EntityNavigation extends Object
Modifier and Type | Field and Description |
---|---|
private int |
currentDistance |
protected long |
currentNodeMs |
protected double |
currentNodeTimeout |
protected Path |
currentPath |
private BlockPos |
currentTarget |
protected MobEntity |
entity |
protected long |
lastActiveTickMs |
protected Vec3i |
lastNodePosition |
protected long |
lastRecalculateTime |
private boolean |
nearPathStartPos |
protected PathNodeMaker |
nodeMaker |
protected float |
nodeReachProximity
If the Chebyshev distance from the entity to the next node is less than
or equal to this value, the entity is considered "reached" the node.
|
private PathNodeNavigator |
pathNodeNavigator |
protected Vec3d |
pathStartPos |
protected int |
pathStartTime |
private float |
rangeMultiplier |
protected boolean |
shouldRecalculate |
protected double |
speed |
protected int |
tickCount |
protected World |
world |
Constructor and Description |
---|
EntityNavigation(MobEntity mob,
World world) |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustPath()
Adjusts the current path according to various special obstacles that may be in the way, for example sunlight
|
protected abstract boolean |
canPathDirectlyThrough(Vec3d origin,
Vec3d target,
int sizeX,
int sizeY,
int sizeZ) |
boolean |
canSwim() |
protected void |
checkTimeouts(Vec3d currentPos) |
protected void |
continueFollowingPath() |
protected abstract PathNodeNavigator |
createPathNodeNavigator(int range) |
Path |
findPathTo(BlockPos target,
int distance) |
Path |
findPathTo(double x,
double y,
double z,
int distance) |
Path |
findPathTo(Entity entity,
int distance) |
protected Path |
findPathToAny(Set<BlockPos> positions,
int range,
boolean bool,
int distance) |
Path |
findPathToAny(Stream<BlockPos> positions,
int distance) |
Path |
getCurrentPath() |
PathNodeMaker |
getNodeMaker() |
protected abstract Vec3d |
getPos()
The position to act as if the entity is at for pathfinding purposes
|
BlockPos |
getTargetPos() |
protected abstract boolean |
isAtValidPosition() |
boolean |
isFollowingPath() |
boolean |
isIdle() |
protected boolean |
isInLiquid() |
boolean |
isNearPathStartPos() |
boolean |
isValidPosition(BlockPos pos) |
private boolean |
method_27799(Vec3d vec3d) |
Path |
method_29934(Set<BlockPos> set,
int int2) |
void |
onBlockChanged(BlockPos pos) |
void |
recalculatePath() |
private void |
resetNode() |
private void |
resetNodeAndStop() |
void |
resetRangeMultiplier() |
void |
setCanSwim(boolean canSwim) |
void |
setRangeMultiplier(float rangeMultiplier) |
void |
setSpeed(double speed) |
boolean |
shouldRecalculatePath() |
boolean |
startMovingAlong(Path path,
double speed) |
boolean |
startMovingTo(double x,
double y,
double z,
double speed) |
boolean |
startMovingTo(Entity entity,
double speed) |
void |
stop() |
void |
tick() |
protected final MobEntity entity
protected final World world
protected double speed
protected int tickCount
protected int pathStartTime
protected Vec3d pathStartPos
protected Vec3i lastNodePosition
protected long currentNodeMs
protected long lastActiveTickMs
protected double currentNodeTimeout
protected float nodeReachProximity
protected boolean shouldRecalculate
protected long lastRecalculateTime
protected PathNodeMaker nodeMaker
private BlockPos currentTarget
private int currentDistance
private float rangeMultiplier
private final PathNodeNavigator pathNodeNavigator
private boolean nearPathStartPos
public void resetRangeMultiplier()
public void setRangeMultiplier(float rangeMultiplier)
public BlockPos getTargetPos()
protected abstract PathNodeNavigator createPathNodeNavigator(int range)
public void setSpeed(double speed)
public boolean shouldRecalculatePath()
public void recalculatePath()
@Nullable protected Path findPathToAny(Set<BlockPos> positions, int range, boolean bool, int distance)
public boolean startMovingTo(double x, double y, double z, double speed)
public boolean startMovingTo(Entity entity, double speed)
public void tick()
protected void continueFollowingPath()
private boolean method_27799(Vec3d vec3d)
protected void checkTimeouts(Vec3d currentPos)
private void resetNodeAndStop()
private void resetNode()
public boolean isIdle()
public boolean isFollowingPath()
public void stop()
protected abstract Vec3d getPos()
protected abstract boolean isAtValidPosition()
protected boolean isInLiquid()
protected void adjustPath()
protected abstract boolean canPathDirectlyThrough(Vec3d origin, Vec3d target, int sizeX, int sizeY, int sizeZ)
public boolean isValidPosition(BlockPos pos)
public PathNodeMaker getNodeMaker()
public void setCanSwim(boolean canSwim)
public boolean canSwim()
public void onBlockChanged(BlockPos pos)
public boolean isNearPathStartPos()