Class JobEnchanter
java.lang.Object
com.minecolonies.core.colony.jobs.AbstractJob<AI,J>
com.minecolonies.core.colony.jobs.AbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
com.minecolonies.core.colony.jobs.JobEnchanter
- All Implemented Interfaces:
IJob<EntityAIWorkEnchanter>,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
Field Summary
Fields 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) Generate your AI class to register.@NotNull net.minecraft.resources.ResourceLocationgetModel()Get the RenderBipedCitizen.Model to use when the Citizen performs this job role.net.minecraft.core.BlockPosGet the current set pos to drain from.booleanIncrement the waiting ticks.voidplaySound(net.minecraft.core.BlockPos blockPos, EntityCitizen worker) Play a job specific work sound at a pos.net.minecraft.nbt.CompoundTagvoidsetBuildingToDrainFrom(net.minecraft.core.BlockPos pos) Set the building the worker is currently draining.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, 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, getSaturationFactor, initEntityValues, isGuard, onLevelUp, triggerActivityChangeAction
-
Constructor Details
-
JobEnchanter
Initialize citizen data.- Parameters:
entity- the citizen data.
-
-
Method Details
-
getModel
@NotNull public @NotNull net.minecraft.resources.ResourceLocation getModel()Get the RenderBipedCitizen.Model to use when the Citizen performs this job role.- Specified by:
getModelin interfaceIJob<EntityAIWorkEnchanter>- Overrides:
getModelin classAbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter> - Returns:
- Model of the citizen.
-
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.
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classAbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
-
setBuildingToDrainFrom
public void setBuildingToDrainFrom(net.minecraft.core.BlockPos pos) Set the building the worker is currently draining.- Parameters:
pos- the pos of the building to drain.
-
getPosToDrainFrom
public net.minecraft.core.BlockPos getPosToDrainFrom()Get the current set pos to drain from.- Returns:
- the pos.
-
incrementWaitingTicks
public boolean incrementWaitingTicks()Increment the waiting ticks.- Returns:
- false if limit reached.
-
playSound
Description copied from class:AbstractJobCrafterPlay a job specific work sound at a pos.- Overrides:
playSoundin classAbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter> - Parameters:
blockPos- the pos to play it at.worker- the worker to play it for.
-