public abstract class Task<E extends LivingEntity>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Task.Status |
Modifier and Type | Field and Description |
---|---|
private int |
durationMax |
private int |
durationMin |
private java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> |
requiredMemoryState |
private Task.Status |
status |
private long |
stopTime |
Constructor and Description |
---|
Task(java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> requiredMemoryStateIn) |
Task(java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> requiredMemoryStateIn,
int duration) |
Task(java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> requiredMemoryStateIn,
int durationMinIn,
int durationMaxIn) |
Modifier and Type | Method and Description |
---|---|
Task.Status |
getStatus() |
private boolean |
hasRequiredMemories(E owner) |
protected boolean |
isTimedOut(long gameTime) |
protected void |
resetTask(ServerWorld worldIn,
E entityIn,
long gameTimeIn) |
protected boolean |
shouldContinueExecuting(ServerWorld worldIn,
E entityIn,
long gameTimeIn) |
protected boolean |
shouldExecute(ServerWorld worldIn,
E owner) |
boolean |
start(ServerWorld worldIn,
E owner,
long gameTime) |
protected void |
startExecuting(ServerWorld worldIn,
E entityIn,
long gameTimeIn) |
void |
stop(ServerWorld worldIn,
E entityIn,
long gameTimeIn) |
void |
tick(ServerWorld worldIn,
E entityIn,
long gameTime) |
java.lang.String |
toString() |
protected void |
updateTask(ServerWorld worldIn,
E owner,
long gameTime) |
private final java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> requiredMemoryState
private Task.Status status
private long stopTime
private final int durationMin
private final int durationMax
public Task(java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> requiredMemoryStateIn)
public Task(java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> requiredMemoryStateIn, int duration)
public Task(java.util.Map<MemoryModuleType<?>,MemoryModuleStatus> requiredMemoryStateIn, int durationMinIn, int durationMaxIn)
public Task.Status getStatus()
public final boolean start(ServerWorld worldIn, E owner, long gameTime)
protected void startExecuting(ServerWorld worldIn, E entityIn, long gameTimeIn)
public final void tick(ServerWorld worldIn, E entityIn, long gameTime)
protected void updateTask(ServerWorld worldIn, E owner, long gameTime)
public final void stop(ServerWorld worldIn, E entityIn, long gameTimeIn)
protected void resetTask(ServerWorld worldIn, E entityIn, long gameTimeIn)
protected boolean shouldContinueExecuting(ServerWorld worldIn, E entityIn, long gameTimeIn)
protected boolean isTimedOut(long gameTime)
protected boolean shouldExecute(ServerWorld worldIn, E owner)
public java.lang.String toString()
toString
in class java.lang.Object
private boolean hasRequiredMemories(E owner)