Class EntityAIWorkFisherman
java.lang.Object
com.minecolonies.core.entity.ai.workers.AbstractAISkeleton<J>
com.minecolonies.core.entity.ai.workers.AbstractEntityAIBasic<J,B>
com.minecolonies.core.entity.ai.workers.AbstractEntityAISkill<JobFisherman,BuildingFisherman>
com.minecolonies.core.entity.ai.workers.production.agriculture.EntityAIWorkFisherman
- All Implemented Interfaces:
ITickingStateAI
Fisherman AI class.
A fisherman has some ponds where he randomly selects one and fishes there.
To keep it immersive he chooses his place at random around the pond.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe render name to render fish.static final StringThe render name to render rod.static final intHow close to a suboptimal pond the fisherman has to be before he complains.Fields inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIBasic
building, currentWorkingLocation, needsCurrently, NO_TOOL, REQUEST_DELAY, STANDARD_DELAY, WALK_DELAY, walkTo, workPosIndexFields inherited from class com.minecolonies.core.entity.ai.workers.AbstractAISkeleton
job, worker, world -
Constructor Summary
ConstructorsConstructorDescriptionEntityAIWorkFisherman(@NotNull JobFisherman job) Constructor for the Fisherman. -
Method Summary
Modifier and TypeMethodDescriptionprotected intCalculates after how many actions the ai should dump it's inventory.@Nullable AbstractEntityCitizenReturns the fisherman's worker instance.Can be overridden in implementations to return the exact building type the worker expects.searchWater(int range, double speed, List<Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos>> ponds) Used to find a water.protected voidHere the AI can check if the fishes or rods have to be re rendered and do it.Methods inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIBasic
afterDump, afterRequestPickUp, cancelAsynchRequestForArmor, canGoIdle, checkAndTransferFromHut, checkForToolOrWeapon, checkForToolOrWeapon, checkForToolOrWeaponAsync, checkIfNeedsItem, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForTagExistOrCreateAsync, getBuildingToDump, getEffectiveSkillLevel, getExceptionTimer, getFakePlayer, getInventory, getInvertedEffectiveSkillLevel, getModuleForJob, getMostEfficientTool, getPrimarySkillLevel, getSecondarySkillLevel, getStateAfterPickUp, getTotalRequiredAmount, getWorkingPosition, getWorkingPosition, hasNotDelayed, holdEfficientTool, incrementActionsDone, incrementActionsDone, incrementActionsDoneAndDecSaturation, inventoryNeedsDump, isAfterDumpPickupAllowed, itemsNiceToHave, onException, resetActionsDone, retrieveToolInHut, retrieveToolInTileEntity, setDelay, takeItemStackFromProvider, waitForRequests, walkToBuilding, walkToBuilding, walkToSafePos, walkToTaggedWorkPos, walkToUnSafePos, walkToUnSafePos, walkToWorkPos, walkWithProxy, walkWithProxy, wantInventoryDumpedMethods inherited from class com.minecolonies.core.entity.ai.workers.AbstractAISkeleton
canBeInterrupted, getState, getStateAI, getTickRate, onRemoval, registerGroupTarget, registerTarget, registerTargets, resetAI, setCurrentDelay, tick
-
Field Details
-
RENDER_META_FISH
The render name to render fish.- See Also:
-
RENDER_META_ROD
The render name to render rod.- See Also:
-
SUBOPTIMAL_POND_COMPLAINT_DISTANCE
public static final int SUBOPTIMAL_POND_COMPLAINT_DISTANCEHow close to a suboptimal pond the fisherman has to be before he complains.- See Also:
-
-
Constructor Details
-
EntityAIWorkFisherman
Constructor for the Fisherman. Defines the tasks the fisherman executes.- Parameters:
job- a fisherman job to use.
-
-
Method Details
-
getExpectedBuildingClass
Description copied from class:AbstractEntityAIBasicCan be overridden in implementations to return the exact building type the worker expects.- Specified by:
getExpectedBuildingClassin classAbstractEntityAIBasic<JobFisherman,BuildingFisherman> - Returns:
- the building type associated with this AI's worker.
-
getActionsDoneUntilDumping
protected int getActionsDoneUntilDumping()Description copied from class:AbstractEntityAIBasicCalculates after how many actions the ai should dump it's inventory.Override this to change the value.
- Overrides:
getActionsDoneUntilDumpingin classAbstractEntityAIBasic<JobFisherman,BuildingFisherman> - Returns:
- the number of actions done before item dump.
-
updateRenderMetaData
protected void updateRenderMetaData()Here the AI can check if the fishes or rods have to be re rendered and do it.- Overrides:
updateRenderMetaDatain classAbstractEntityAIBasic<JobFisherman,BuildingFisherman>
-
searchWater
public WaterPathResult searchWater(int range, double speed, List<Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos>> ponds) Used to find a water.- Parameters:
range- in the range.speed- walking speed.ponds- a list of ponds.- Returns:
- the result of the search.
-
getCitizen
Returns the fisherman's worker instance. Called from outside this class.- Returns:
- citizen object.
-