Class AbstractJobGuard<J extends AbstractJobGuard<J>>
java.lang.Object
com.minecolonies.core.colony.jobs.AbstractJob<AbstractEntityAIGuard<J,? extends AbstractBuildingGuards>,J>
com.minecolonies.core.colony.jobs.AbstractJobGuard<J>
- All Implemented Interfaces:
IJob<AbstractEntityAIGuard<J,,? extends AbstractBuildingGuards>> net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
JobCavalry,JobDruid,JobKnight,JobRanger
public abstract class AbstractJobGuard<J extends AbstractJobGuard<J>>
extends AbstractJob<AbstractEntityAIGuard<J,? extends AbstractBuildingGuards>,J>
Abstract Class for Guard Jobs.
-
Field Summary
Fields inherited from class com.minecolonies.core.colony.jobs.AbstractJob
workBuilding, workBuildingPos, workModule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethod to check if the colony job allows avoidance.AbstractEntityAIGuard<J,? extends AbstractBuildingGuards> Generate your AI class to register.protected abstract AbstractEntityAIGuard<J,? extends AbstractBuildingGuards> doubleJob saturation factor.voidinitEntityValues(AbstractEntityCitizen citizen) Initizalizes values for an entity when the entity is spawned/assigned to the jobbooleanisAsleep()Whether the guard is asleep.booleanisGuard()Whether the job is a guardvoidtriggerDeathAchievement(net.minecraft.world.damagesource.DamageSource source, AbstractEntityCitizen citizen) Override this to implement Job specific death achievements.Methods inherited from class com.minecolonies.core.colony.jobs.AbstractJob
assignTo, canAIBeInterrupted, clearActionsDone, createAI, deserializeNBT, equals, getActionsDone, getAsyncRequests, getBuildingPos, getCitizen, getColony, getDiseaseModifier, getJobRegistryEntry, getModel, getNameTagDescription, getWorkBuilding, getWorkerAI, getWorkModule, hasCheckedForFoodToday, hashCode, ignoresDamage, incrementActionsDone, incrementActionsDone, isIdling, markRequestSync, onRemoval, onStackPickUp, onWakeUp, pickupSuccess, processOfflineTime, resetAI, serializeNBT, serializeToView, setCheckedForFood, setNameTag, setRegistryEntryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.jobs.IJob
getIdleSeverity, getInactivityLimit, onLevelUp, triggerActivityChangeAction
-
Constructor Details
-
AbstractJobGuard
Initialize citizen data.- Parameters:
entity- the citizen data.
-
-
Method Details
-
generateGuardAI
-
generateAI
Description copied from interface:IJobGenerate your AI class to register.Suppressing Sonar Rule squid:S1452 This rule does "Generic wildcard types should not be used in return parameters" But in this case the rule does not apply because We are fine with all AbstractJob implementations and need generics only for java
- Returns:
- your personal AI instance.
-
triggerDeathAchievement
public void triggerDeathAchievement(net.minecraft.world.damagesource.DamageSource source, AbstractEntityCitizen citizen) Description copied from interface:IJobOverride this to implement Job specific death achievements.- Specified by:
triggerDeathAchievementin interfaceIJob<J extends AbstractJobGuard<J>>- Overrides:
triggerDeathAchievementin classAbstractJob<AbstractEntityAIGuard<J extends AbstractJobGuard<J>,? extends AbstractBuildingGuards>, J extends AbstractJobGuard<J>> - Parameters:
source- of the deathcitizen- which just died
-
allowsAvoidance
public boolean allowsAvoidance()Description copied from interface:IJobMethod to check if the colony job allows avoidance.- Specified by:
allowsAvoidancein interfaceIJob<J extends AbstractJobGuard<J>>- Overrides:
allowsAvoidancein classAbstractJob<AbstractEntityAIGuard<J extends AbstractJobGuard<J>,? extends AbstractBuildingGuards>, J extends AbstractJobGuard<J>> - Returns:
- true if so.
-
isGuard
public boolean isGuard()Description copied from interface:IJobWhether the job is a guard- Returns:
-
isAsleep
public boolean isAsleep()Whether the guard is asleep.- Returns:
- true if sleeping
-
initEntityValues
Description copied from interface:IJobInitizalizes values for an entity when the entity is spawned/assigned to the job -
getSaturationFactor
public double getSaturationFactor()Description copied from interface:IJobJob saturation factor.- Returns:
- increase in saturation consumption based on job.
-