Class JobCavalry
java.lang.Object
com.minecolonies.core.colony.jobs.AbstractJob<AbstractEntityAIGuard<JobCavalry,? extends AbstractBuildingGuards>,JobCavalry>
com.minecolonies.core.colony.jobs.AbstractJobGuard<JobCavalry>
com.minecolonies.core.colony.jobs.guard.JobCavalry
- All Implemented Interfaces:
IJob<AbstractEntityAIGuard<JobCavalry,,? extends AbstractBuildingGuards>> net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
The Cavalry job class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final floatprotected UUIDThe UUID of the mount.Fields inherited from class com.minecolonies.core.colony.jobs.AbstractJob
workBuilding, workBuildingPos, workModule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) net.minecraft.resources.ResourceLocationgetModel()Get the RenderBipedCitizen.Model to use when the Citizen performs this job role.getMount()Return the current mount for the cavalry job.floatThe fraction of damage that is applied to the mount instead of the rider.static EquipmentTypeEntryGets the weapon type that the AI will look for when checking if it can attack.booleanignoresDamage(@NotNull net.minecraft.world.damagesource.DamageSource damageSource) Whether the citizen will ignore damage from the given source.booleanIf the cavalry unity is missing a mount.voidFired when level increases.net.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) voidSets the mount UUID.Methods inherited from class com.minecolonies.core.colony.jobs.AbstractJobGuard
allowsAvoidance, generateAI, getSaturationFactor, initEntityValues, isAsleep, isGuard, triggerDeathAchievementMethods inherited from class com.minecolonies.core.colony.jobs.AbstractJob
assignTo, canAIBeInterrupted, clearActionsDone, createAI, equals, getActionsDone, getAsyncRequests, getBuildingPos, getCitizen, getColony, getDiseaseModifier, getJobRegistryEntry, getNameTagDescription, getWorkBuilding, getWorkerAI, getWorkModule, hasCheckedForFoodToday, hashCode, incrementActionsDone, incrementActionsDone, isIdling, markRequestSync, onRemoval, onStackPickUp, onWakeUp, pickupSuccess, processOfflineTime, resetAI, 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, triggerActivityChangeAction
-
Field Details
-
MOUNT_DAMAGE_SPLIT
public static final float MOUNT_DAMAGE_SPLIT- See Also:
-
DININGHALL_HORSE_PARKING_RANGE
public static final int DININGHALL_HORSE_PARKING_RANGE- See Also:
-
myMount
The UUID of the mount.
-
-
Constructor Details
-
JobCavalry
Initialize citizen data.- Parameters:
entity- the citizen data.
-
-
Method Details
-
generateGuardAI
- Specified by:
generateGuardAIin classAbstractJobGuard<JobCavalry>
-
onLevelUp
public void onLevelUp()Fired when level increases. -
getModel
public net.minecraft.resources.ResourceLocation getModel()Description copied from interface:IJobGet the RenderBipedCitizen.Model to use when the Citizen performs this job role.- Specified by:
getModelin interfaceIJob<AbstractEntityAIGuard<JobCavalry,? extends AbstractBuildingGuards>> - Overrides:
getModelin classAbstractJob<AbstractEntityAIGuard<JobCavalry,? extends AbstractBuildingGuards>, JobCavalry> - Returns:
- Model of the citizen.
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
serializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classAbstractJob<AbstractEntityAIGuard<JobCavalry,? extends AbstractBuildingGuards>, JobCavalry>
-
deserializeNBT
public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractJob<AbstractEntityAIGuard<JobCavalry,? extends AbstractBuildingGuards>, JobCavalry>
-
ignoresDamage
public boolean ignoresDamage(@NotNull @NotNull net.minecraft.world.damagesource.DamageSource damageSource) Whether the citizen will ignore damage from the given source. Units will ignore explosion and projectile damage if they have a shield in their offhand and the SHIELD_USAGE research is enabled.- Specified by:
ignoresDamagein interfaceIJob<AbstractEntityAIGuard<JobCavalry,? extends AbstractBuildingGuards>> - Overrides:
ignoresDamagein classAbstractJob<AbstractEntityAIGuard<JobCavalry,? extends AbstractBuildingGuards>, JobCavalry> - Parameters:
damageSource- the source of the damage- Returns:
- true if the citizen will ignore the damage, false otherwise
-
isMissingMount
public boolean isMissingMount()If the cavalry unity is missing a mount.- Returns:
- true if so.
-
setMount
Sets the mount UUID.- Parameters:
mountUUID- the mount UUID.
-
getMount
Return the current mount for the cavalry job.- Returns:
-
getMountDamageSplit
public float getMountDamageSplit()The fraction of damage that is applied to the mount instead of the rider. This is used to calculate the damage to apply to the mount when the rider is attacked.- Returns:
- the fraction of damage to apply to the mount.
-
getWeaponType
Gets the weapon type that the AI will look for when checking if it can attack.- Returns:
- the weapon type.
-