public class FindEntityTask<E extends LivingEntity,T extends LivingEntity> extends Task<E>
Task.Status
Modifier and Type | Field and Description |
---|---|
private int |
completionRange |
private EntityType<? extends T> |
entityType |
private int |
maxSquaredDistance |
private Predicate<T> |
predicate |
private Predicate<E> |
shouldRunPredicate |
private float |
speed |
private MemoryModuleType<T> |
targetModule |
requiredMemoryStates
Constructor and Description |
---|
FindEntityTask(EntityType<? extends T> entityType,
int maxDistance,
Predicate<E> shouldRunPredicate,
Predicate<T> predicate,
MemoryModuleType<T> targetModule,
float speed,
int completionRange) |
Modifier and Type | Method and Description |
---|---|
static <T extends LivingEntity> |
create(EntityType<? extends T> entityType,
int maxDistance,
MemoryModuleType<T> targetModule,
float speed,
int completionRange) |
private boolean |
method_24582(E e) |
private boolean |
method_24583(LivingEntity livingEntity) |
protected void |
run(ServerWorld world,
E entity,
long time) |
protected boolean |
shouldRun(ServerWorld world,
E entity) |
finishRunning, getStatus, isTimeLimitExceeded, keepRunning, shouldKeepRunning, stop, tick, toString, tryStarting
private final int completionRange
private final float speed
private final EntityType<? extends T extends LivingEntity> entityType
private final int maxSquaredDistance
private final Predicate<T extends LivingEntity> predicate
private final Predicate<E extends LivingEntity> shouldRunPredicate
private final MemoryModuleType<T extends LivingEntity> targetModule
public FindEntityTask(EntityType<? extends T> entityType, int maxDistance, Predicate<E> shouldRunPredicate, Predicate<T> predicate, MemoryModuleType<T> targetModule, float speed, int completionRange)
public static <T extends LivingEntity> FindEntityTask<LivingEntity,T> create(EntityType<? extends T> entityType, int maxDistance, MemoryModuleType<T> targetModule, float speed, int completionRange)
protected boolean shouldRun(ServerWorld world, E entity)
shouldRun
in class Task<E extends LivingEntity>
private boolean method_24582(E e)
private boolean method_24583(LivingEntity livingEntity)
protected void run(ServerWorld world, E entity, long time)
run
in class Task<E extends LivingEntity>