public abstract class Task<E extends LivingEntity> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Task.Status |
Modifier and Type | Field and Description |
---|---|
private long |
endTime |
private int |
maxRunTime |
private int |
minRunTime |
protected Map<MemoryModuleType<?>,MemoryModuleState> |
requiredMemoryStates |
private Task.Status |
status |
Constructor and Description |
---|
Task(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState) |
Task(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState,
int runTime) |
Task(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState,
int minRunTime,
int maxRunTime) |
Modifier and Type | Method and Description |
---|---|
protected void |
finishRunning(ServerWorld world,
E entity,
long time) |
Task.Status |
getStatus() |
private boolean |
hasRequiredMemoryState(E e) |
protected boolean |
isTimeLimitExceeded(long time) |
protected void |
keepRunning(ServerWorld world,
E entity,
long time) |
protected void |
run(ServerWorld world,
E entity,
long time) |
protected boolean |
shouldKeepRunning(ServerWorld world,
E entity,
long time) |
protected boolean |
shouldRun(ServerWorld world,
E entity) |
void |
stop(ServerWorld world,
E entity,
long time) |
void |
tick(ServerWorld world,
E entity,
long time) |
String |
toString() |
boolean |
tryStarting(ServerWorld world,
E entity,
long time) |
protected final Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryStates
private Task.Status status
private long endTime
private final int minRunTime
private final int maxRunTime
public Task(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState)
public Task(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState, int runTime)
public Task(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState, int minRunTime, int maxRunTime)
public Task.Status getStatus()
public final boolean tryStarting(ServerWorld world, E entity, long time)
protected void run(ServerWorld world, E entity, long time)
public final void tick(ServerWorld world, E entity, long time)
protected void keepRunning(ServerWorld world, E entity, long time)
public final void stop(ServerWorld world, E entity, long time)
protected void finishRunning(ServerWorld world, E entity, long time)
protected boolean shouldKeepRunning(ServerWorld world, E entity, long time)
protected boolean isTimeLimitExceeded(long time)
protected boolean shouldRun(ServerWorld world, E entity)
private boolean hasRequiredMemoryState(E e)