public abstract class EntityTask extends Object implements Comparable<EntityTask>
Constructor and Description |
---|
EntityTask(@NonNls String name) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(EntityTask other) |
abstract void |
end(GlowLivingEntity entity)
Invoked when this task is being ended for this entity.
|
abstract void |
execute(GlowLivingEntity entity)
Invoked each tick when this task is being executed for this entity.
|
abstract int |
getDurationMax()
The maximum duration of this task.
|
abstract int |
getDurationMin()
The minimum duration of this task.
|
String |
getName()
The name of this EntityTask.
|
boolean |
isExecuting()
Whether this task is currently being executed.
|
abstract boolean |
isInstant()
Whether this task is instant.
|
boolean |
isPaused()
Whether this task is paused.
|
void |
pause(GlowLivingEntity entity)
Pauses this task for this entity.
|
void |
pulse(GlowLivingEntity entity)
Advances this task by a tick on the given entity.
|
void |
reset(GlowLivingEntity entity)
Resets the progress of this task for this entity.
|
void |
resume(GlowLivingEntity entity)
Resumes the previously paused task for this entity.
|
abstract boolean |
shouldStart(GlowLivingEntity entity)
Whether the task should begin executing for this entity.
|
abstract void |
start(GlowLivingEntity entity)
Invoked when this task is about to start for this entity.
|
public EntityTask(@NonNls @NonNls String name)
public int compareTo(EntityTask other)
compareTo
in interface Comparable<EntityTask>
public final void pulse(GlowLivingEntity entity)
entity
- the entity to run onpublic void reset(GlowLivingEntity entity)
entity
- the entity in question.public final void resume(GlowLivingEntity entity)
entity
- the entity in question.public final void pause(GlowLivingEntity entity)
entity
- the entity in question.public abstract int getDurationMin()
public abstract int getDurationMax()
public abstract boolean shouldStart(GlowLivingEntity entity)
entity
- the entity in question.public abstract void start(GlowLivingEntity entity)
entity
- the entity in question.public abstract void end(GlowLivingEntity entity)
entity
- the entity in question.public abstract void execute(GlowLivingEntity entity)
entity
- the entity in question.public abstract boolean isInstant()
public String getName()
public boolean isExecuting()
public boolean isPaused()
Copyright © 2021. All rights reserved.