public class GoToRememberedPositionTask<T> extends Task<PathAwareEntity>
Task.Status
Modifier and Type | Field and Description |
---|---|
private MemoryModuleType<T> |
entityMemory |
private Function<T,Vec3d> |
posRetriever |
private int |
range |
private float |
speed |
requiredMemoryStates
Constructor and Description |
---|
GoToRememberedPositionTask(MemoryModuleType<T> memoryType,
float speed,
int range,
boolean requiresWalkTarget,
Function<T,Vec3d> posRetriever) |
Modifier and Type | Method and Description |
---|---|
private Vec3d |
getPos(PathAwareEntity entity) |
private boolean |
isWalkTargetPresentAndFar(PathAwareEntity pathAwareEntity) |
protected void |
run(ServerWorld serverWorld,
PathAwareEntity pathAwareEntity,
long long2) |
private static void |
setWalkTarget(PathAwareEntity entity,
Vec3d pos,
float speed) |
protected boolean |
shouldRun(ServerWorld serverWorld,
PathAwareEntity pathAwareEntity) |
static GoToRememberedPositionTask<BlockPos> |
toBlock(MemoryModuleType<BlockPos> memoryType,
float speed,
int range,
boolean requiresWalkTarget) |
static GoToRememberedPositionTask<? extends Entity> |
toEntity(MemoryModuleType<? extends Entity> memoryType,
float speed,
int range,
boolean requiresWalkTarget) |
finishRunning, getStatus, isTimeLimitExceeded, keepRunning, shouldKeepRunning, stop, tick, toString, tryStarting
private final MemoryModuleType<T> entityMemory
private final float speed
private final int range
public GoToRememberedPositionTask(MemoryModuleType<T> memoryType, float speed, int range, boolean requiresWalkTarget, Function<T,Vec3d> posRetriever)
public static GoToRememberedPositionTask<BlockPos> toBlock(MemoryModuleType<BlockPos> memoryType, float speed, int range, boolean requiresWalkTarget)
public static GoToRememberedPositionTask<? extends Entity> toEntity(MemoryModuleType<? extends Entity> memoryType, float speed, int range, boolean requiresWalkTarget)
protected boolean shouldRun(ServerWorld serverWorld, PathAwareEntity pathAwareEntity)
shouldRun
in class Task<PathAwareEntity>
private Vec3d getPos(PathAwareEntity entity)
private boolean isWalkTargetPresentAndFar(PathAwareEntity pathAwareEntity)
protected void run(ServerWorld serverWorld, PathAwareEntity pathAwareEntity, long long2)
run
in class Task<PathAwareEntity>
private static void setWalkTarget(PathAwareEntity entity, Vec3d pos, float speed)