Class CitizenJobHandler
java.lang.Object
com.minecolonies.core.entity.citizen.citizenhandlers.CitizenJobHandler
- All Implemented Interfaces:
ICitizenJobHandler
Handles the citizen job methods.
-
Constructor Summary
ConstructorsConstructorDescriptionCitizenJobHandler(AbstractEntityCitizen citizen) Constructor for the experience handler. -
Method Summary
Modifier and TypeMethodDescription@Nullable IJob<?> Gets the job of the entity.<J extends IJob<?>>
JgetColonyJob(@NotNull Class<J> type) Get the job of the citizen.Get the AI running for this jobvoidonJobChanged(@Nullable IJob<?> job) Defines job changes and state changes of the citizen.voidsetModelDependingOnJob(@Nullable IJob<?> job) Set Model depending on job.voidsetWorkAI(ITickingStateAI workAI) Sets the work AI used in this jobbooleanMethod to check if the citizen job allows to run the avoidance task.
-
Constructor Details
-
CitizenJobHandler
Constructor for the experience handler.- Parameters:
citizen- the citizen owning the handler.
-
-
Method Details
-
setModelDependingOnJob
Set Model depending on job.- Specified by:
setModelDependingOnJobin interfaceICitizenJobHandler- Parameters:
job- the new job.
-
onJobChanged
Defines job changes and state changes of the citizen.- Specified by:
onJobChangedin interfaceICitizenJobHandler- Parameters:
job- the set job.
-
getColonyJob
Get the job of the citizen.- Specified by:
getColonyJobin interfaceICitizenJobHandler- Type Parameters:
J- wildcard.- Parameters:
type- of the type.- Returns:
- the job.
-
getColonyJob
Gets the job of the entity.- Specified by:
getColonyJobin interfaceICitizenJobHandler- Returns:
- the job or els enull.
-
shouldRunAvoidance
public boolean shouldRunAvoidance()Description copied from interface:ICitizenJobHandlerMethod to check if the citizen job allows to run the avoidance task.- Specified by:
shouldRunAvoidancein interfaceICitizenJobHandler- Returns:
- true if so.
-
setWorkAI
Description copied from interface:ICitizenJobHandlerSets the work AI used in this job- Specified by:
setWorkAIin interfaceICitizenJobHandler- Parameters:
workAI-
-
getWorkAI
Description copied from interface:ICitizenJobHandlerGet the AI running for this job- Specified by:
getWorkAIin interfaceICitizenJobHandler- Returns:
-