public class TimeLimitedTask<E extends LivingEntity> extends Task<E>
Task.Status
Modifier and Type | Field and Description |
---|---|
private Task<? super E> |
delegate |
private boolean |
delegateRunning |
private boolean |
needsTimeReset |
private int |
timeLeft |
private IntRange |
timeRange |
requiredMemoryStates
Constructor and Description |
---|
TimeLimitedTask(Task<? super E> delegate,
boolean skipFirstRun,
IntRange timeRange) |
TimeLimitedTask(Task<? super E> delegate,
IntRange timeRange) |
Modifier and Type | Method and Description |
---|---|
protected void |
finishRunning(ServerWorld world,
E entity,
long time) |
protected boolean |
isTimeLimitExceeded(long time) |
protected void |
keepRunning(ServerWorld world,
E entity,
long time) |
private void |
resetTimeLeft(ServerWorld world) |
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) |
String |
toString() |
getStatus, stop, tick, tryStarting
private boolean needsTimeReset
private boolean delegateRunning
private final IntRange timeRange
private final Task<? super E extends LivingEntity> delegate
private int timeLeft
protected boolean shouldRun(ServerWorld world, E entity)
shouldRun
in class Task<E extends LivingEntity>
protected void run(ServerWorld world, E entity, long time)
run
in class Task<E extends LivingEntity>
protected boolean shouldKeepRunning(ServerWorld world, E entity, long time)
shouldKeepRunning
in class Task<E extends LivingEntity>
protected void keepRunning(ServerWorld world, E entity, long time)
keepRunning
in class Task<E extends LivingEntity>
protected void finishRunning(ServerWorld world, E entity, long time)
finishRunning
in class Task<E extends LivingEntity>
private void resetTimeLeft(ServerWorld world)
protected boolean isTimeLimitExceeded(long time)
isTimeLimitExceeded
in class Task<E extends LivingEntity>
public String toString()
toString
in class Task<E extends LivingEntity>