Class JobLumberjack
java.lang.Object
com.minecolonies.core.colony.jobs.AbstractJob<AI,J>
com.minecolonies.core.colony.jobs.AbstractJobCrafter<EntityAIWorkLumberjack,JobLumberjack>
com.minecolonies.core.colony.jobs.JobLumberjack
- All Implemented Interfaces:
IJob<EntityAIWorkLumberjack>,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
The Lumberjack job class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleWalking speed bonus per levelFields inherited from class com.minecolonies.core.colony.jobs.AbstractJob
workBuilding, workBuildingPos, workModule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) @NotNull EntityAIWorkLumberjackGenerate your AI class to register.@NotNull net.minecraft.resources.ResourceLocationgetModel()Get the RenderBipedCitizen.Model to use when the Citizen performs this job role.doubleJob saturation factor.@Nullable TreegetTree()Get the current tree the lumberjack is cutting.voidLevelup actions on citizen levelup, allows custom actions based on Jobsnet.minecraft.nbt.CompoundTagvoidSet the tree he is currently cutting.Methods inherited from class com.minecolonies.core.colony.jobs.AbstractJobCrafter
addRequest, finishRequest, getAssignedTasks, getAssignedTasksFromDataStore, getCraftCounter, getCurrentTask, getMaxCraftingCount, getProgress, getSecondaryOutputs, getTaskQueue, hasTask, onRemoval, onTaskBeingResolved, onTaskBeingScheduled, onTaskDeletion, playSound, serializeToView, setCraftCounter, setMaxCraftingCount, setProgressMethods inherited from class com.minecolonies.core.colony.jobs.AbstractJob
allowsAvoidance, assignTo, canAIBeInterrupted, clearActionsDone, createAI, equals, getActionsDone, getAsyncRequests, getBuildingPos, getCitizen, getColony, getDiseaseModifier, getJobRegistryEntry, getNameTagDescription, getWorkBuilding, getWorkerAI, getWorkModule, hasCheckedForFoodToday, hashCode, ignoresDamage, incrementActionsDone, incrementActionsDone, isIdling, markRequestSync, onStackPickUp, onWakeUp, pickupSuccess, processOfflineTime, resetAI, setCheckedForFood, setNameTag, setRegistryEntry, triggerDeathAchievementMethods 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, initEntityValues, isGuard, triggerActivityChangeAction
-
Field Details
-
BONUS_SPEED_PER_LEVEL
public static final double BONUS_SPEED_PER_LEVELWalking speed bonus per level- See Also:
-
-
Constructor Details
-
JobLumberjack
Create a lumberjack job.- Parameters:
entity- the lumberjack.
-
-
Method Details
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classAbstractJobCrafter<EntityAIWorkLumberjack,JobLumberjack>
-
getModel
@NotNull public @NotNull 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<EntityAIWorkLumberjack>- Overrides:
getModelin classAbstractJobCrafter<EntityAIWorkLumberjack,JobLumberjack> - Returns:
- Model of the citizen.
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractJobCrafter<EntityAIWorkLumberjack,JobLumberjack>
-
onLevelUp
public void onLevelUp()Description copied from interface:IJobLevelup actions on citizen levelup, allows custom actions based on Jobs -
getTree
Get the current tree the lumberjack is cutting.- Returns:
- the tree.
-
setTree
Set the tree he is currently cutting.- Parameters:
tree- the tree.
-
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.
-
getSaturationFactor
public double getSaturationFactor()Description copied from interface:IJobJob saturation factor.- Returns:
- increase in saturation consumption based on job.
-