public class CompositeTask<E extends LivingEntity> extends Task<E>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
CompositeTask.Order |
(package private) static class |
CompositeTask.RunMode |
Task.Status
Modifier and Type | Field and Description |
---|---|
private Set<MemoryModuleType<?>> |
memoriesToForgetWhenStopped |
private CompositeTask.Order |
order |
private CompositeTask.RunMode |
runMode |
private WeightedList<Task<? super E>> |
tasks |
requiredMemoryStates
Constructor and Description |
---|
CompositeTask(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState,
Set<MemoryModuleType<?>> memoriesToForgetWhenStopped,
CompositeTask.Order order,
CompositeTask.RunMode runMode,
List<com.mojang.datafixers.util.Pair<Task<? super E>,Integer>> tasks) |
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) |
protected void |
run(ServerWorld world,
E entity,
long time) |
protected boolean |
shouldKeepRunning(ServerWorld world,
E entity,
long time) |
String |
toString() |
private final Set<MemoryModuleType<?>> memoriesToForgetWhenStopped
private final CompositeTask.Order order
private final CompositeTask.RunMode runMode
private final WeightedList<Task<? super E extends LivingEntity>> tasks
public CompositeTask(Map<MemoryModuleType<?>,MemoryModuleState> requiredMemoryState, Set<MemoryModuleType<?>> memoriesToForgetWhenStopped, CompositeTask.Order order, CompositeTask.RunMode runMode, List<com.mojang.datafixers.util.Pair<Task<? super E>,Integer>> tasks)
protected boolean shouldKeepRunning(ServerWorld world, E entity, long time)
shouldKeepRunning
in class Task<E extends LivingEntity>
protected boolean isTimeLimitExceeded(long time)
isTimeLimitExceeded
in class Task<E extends LivingEntity>
protected void run(ServerWorld world, E entity, long time)
run
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>
public String toString()
toString
in class Task<E extends LivingEntity>