public class TaskManager extends Object
Constructor and Description |
---|
TaskManager(GlowLivingEntity entity) |
Modifier and Type | Method and Description |
---|---|
void |
addTask(EntityTask task)
Add the given task, replacing any existing task with the same name.
|
void |
addTask(String taskName)
Add the task with this name, or replace it with a new instance if it already exists.
|
void |
cancel(EntityTask task)
Cancels and unregisters the given task.
|
void |
cancelTasks()
Cancels and unregisters all tasks.
|
EntityTask |
getNewTask(String name)
Returns a new instance of the task with a given name.
|
EntityTask |
getTask(Class<? extends EntityTask> clazz)
Returns the existing task whose class is exactly a given class (and not a subclass -- this
will always return null for an abstract type).
|
EntityTask |
getTask(String name)
Returns the existing task with a given name.
|
void |
pulse() |
void |
updateState()
Rebuild the list of tasks according to
(EntityType, MobState) . |
public TaskManager(GlowLivingEntity entity)
public EntityTask getTask(String name)
name
- the name to look uppublic EntityTask getTask(Class<? extends EntityTask> clazz)
clazz
- the class to look uppublic EntityTask getNewTask(String name)
name
- the task name to look uppublic void updateState()
(EntityType, MobState)
.public void cancel(EntityTask task)
task
- the task to cancelpublic void cancelTasks()
public void pulse()
public void addTask(EntityTask task)
task
- the task to addpublic void addTask(String taskName)
taskName
- the task nameCopyright © 2021. All rights reserved.