Class JobFisherman
java.lang.Object
com.minecolonies.core.colony.jobs.AbstractJob<EntityAIWorkFisherman,JobFisherman>
com.minecolonies.core.colony.jobs.JobFisherman
- All Implemented Interfaces:
IJob<EntityAIWorkFisherman>,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
The fisherman's job class. implements some useful things for him.
-
Field Summary
Fields inherited from class com.minecolonies.core.colony.jobs.AbstractJob
workBuilding, workBuildingPos, workModule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToPonds(net.minecraft.core.BlockPos pond, net.minecraft.core.BlockPos parent) Add one pond to our list of ponds.voiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) @NotNull EntityAIWorkFishermanGenerate your AI class to register.@NotNull net.minecraft.resources.ResourceLocationgetModel()Get the RenderBipedCitizen.Model to use when the Citizen performs this job role.getPonds()Returns a safe copy of all current ponds.Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> getWater()Getter for current water.booleanonStackPickUp(@NotNull net.minecraft.world.item.ItemStack pickedUpStack) Records in hut statistics what the Fisherperson has collected.voidremoveFromPonds(Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> pond) remove one pond from the ponds list.net.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) voidSetter for current water.voidtriggerDeathAchievement(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
allowsAvoidance, assignTo, canAIBeInterrupted, clearActionsDone, createAI, equals, getActionsDone, getAsyncRequests, getBuildingPos, getCitizen, getColony, getDiseaseModifier, getJobRegistryEntry, getNameTagDescription, getWorkBuilding, getWorkerAI, getWorkModule, hasCheckedForFoodToday, hashCode, ignoresDamage, incrementActionsDone, incrementActionsDone, isIdling, markRequestSync, onRemoval, 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, getSaturationFactor, initEntityValues, isGuard, onLevelUp, triggerActivityChangeAction
-
Constructor Details
-
JobFisherman
Initializes the job class.- Parameters:
entity- The entity which will use this job class.
-
-
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<EntityAIWorkFisherman>- Overrides:
getModelin classAbstractJob<EntityAIWorkFisherman,JobFisherman> - 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<EntityAIWorkFisherman,JobFisherman>
-
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<EntityAIWorkFisherman,JobFisherman>
-
generateAI
Generate your AI class to register.- 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<EntityAIWorkFisherman>- Overrides:
triggerDeathAchievementin classAbstractJob<EntityAIWorkFisherman,JobFisherman> - Parameters:
source- of the deathcitizen- which just died
-
getWater
Getter for current water.- Returns:
- Location of the current water block.
-
setWater
Setter for current water.- Parameters:
water- New location for the current water block.
-
getPonds
@NotNull public @NotNull List<Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos>> getPonds()Returns a safe copy of all current ponds.- Returns:
- a list of coordinates.
-
addToPonds
public void addToPonds(net.minecraft.core.BlockPos pond, net.minecraft.core.BlockPos parent) Add one pond to our list of ponds.- Parameters:
pond- the pond to add.parent- the parent position.
-
removeFromPonds
remove one pond from the ponds list.- Parameters:
pond- the coordinate pair matching one pond.
-
onStackPickUp
public boolean onStackPickUp(@NotNull @NotNull net.minecraft.world.item.ItemStack pickedUpStack) Records in hut statistics what the Fisherperson has collected.- Specified by:
onStackPickUpin interfaceIJob<EntityAIWorkFisherman>- Overrides:
onStackPickUpin classAbstractJob<EntityAIWorkFisherman,JobFisherman> - Parameters:
pickedUpStack- The stack that is being picked up.- Returns:
- true when the stack has been used to resolve a request, false when not.
-