Class EntityAIWorkPlanter
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<J,B>
com.minecolonies.core.entity.ai.workers.AbstractEntityAIInteract<J,B>
com.minecolonies.core.entity.ai.workers.crafting.AbstractEntityAICrafting<JobPlanter,BuildingPlantation>
com.minecolonies.core.entity.ai.workers.production.agriculture.EntityAIWorkPlanter
- All Implemented Interfaces:
ITickingStateAI
Planter AI class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intThe amount of bonemeal the worker should have at any time.Fields inherited from class com.minecolonies.core.entity.ai.workers.crafting.AbstractEntityAICrafting
currentRecipeStorage, currentRequest, HIT_DELAY, idlePos, MAX_LEVEL, NO_CHANGE, PROGRESS_MULTIPLIERFields inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIInteract
BLOCK_MINING_DELAY, RANGE_HORIZONTAL_PICKUP, RANGE_VERTICAL_PICKUP, RENDER_META_WORKING, XP_PER_BLOCKFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf the worker currently has work to do or could also just wander around.protected IAIStatedecide()Main method to decide on what to do.protected intCalculates after how many actions the ai should dump it's inventory.Can be overridden in implementations to return the exact building type the worker expects.The state to transform to after picking up things.booleanIf the crafter should go in idle mode or not.voidonBlockDropReception(List<net.minecraft.world.item.ItemStack> blockDrops) Event triggered after receiving a list of block drops.protected voidCan be overridden in implementations.Methods inherited from class com.minecolonies.core.entity.ai.workers.crafting.AbstractEntityAICrafting
afterDump, checkForItems, craft, executeCraftingAction, finalizeCraftingTask, getActionRewardForCraftingSuccess, getCraftingStatName, getExtendedCount, getLootContext, getLootContext, getNextCraftingState, getRecipe, hitBlockWithToolInHand, idle, isAfterDumpPickupAllowed, recordCraftingBuildingStats, resetValuesMethods inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIInteract
fillItemsList, gatherItems, getBlockMiningTime, getBreakSpeedLevel, getItemsForPickUp, increaseBlockDrops, isItemWorthPickingUp, mineBlock, mineBlock, mineBlock, resetGatheringItems, searchForItems, shouldSilkTouchBlock, triggerMinedBlockMethods inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIBasic
afterRequestPickUp, cancelAsynchRequestForArmor, 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, getTotalRequiredAmount, getWorkingPosition, getWorkingPosition, hasNotDelayed, holdEfficientTool, incrementActionsDone, incrementActionsDone, incrementActionsDoneAndDecSaturation, inventoryNeedsDump, 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
-
BONEMEAL_TO_KEEP
protected static final int BONEMEAL_TO_KEEPThe amount of bonemeal the worker should have at any time.- See Also:
-
-
Constructor Details
-
EntityAIWorkPlanter
Constructor for the planter.- Parameters:
job- a planter job to use.
-
-
Method Details
-
onBlockDropReception
Description copied from class:AbstractEntityAIInteractEvent triggered after receiving a list of block drops.- Overrides:
onBlockDropReceptionin classAbstractEntityAIInteract<JobPlanter,BuildingPlantation> - Parameters:
blockDrops- the received items from the block.
-
updateRenderMetaData
protected void updateRenderMetaData()Description copied from class:AbstractEntityAIBasicCan be overridden in implementations.Here the AI can check if the chestBelt has to be re rendered and do it.
- Overrides:
updateRenderMetaDatain classAbstractEntityAICrafting<JobPlanter,BuildingPlantation>
-
decide
Description copied from class:AbstractEntityAICraftingMain method to decide on what to do.- Overrides:
decidein classAbstractEntityAICrafting<JobPlanter,BuildingPlantation> - Returns:
- the next state to go to.
-
getStateAfterPickUp
Description copied from class:AbstractEntityAIBasicThe state to transform to after picking up things.- Overrides:
getStateAfterPickUpin classAbstractEntityAICrafting<JobPlanter,BuildingPlantation> - Returns:
- the next state to go to.
-
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 classAbstractEntityAICrafting<JobPlanter,BuildingPlantation> - Returns:
- the number of actions done before item dump.
-
getExpectedBuildingClass
Description copied from class:AbstractEntityAIBasicCan be overridden in implementations to return the exact building type the worker expects.- Specified by:
getExpectedBuildingClassin classAbstractEntityAIBasic<JobPlanter,BuildingPlantation> - Returns:
- the building type associated with this AI's worker.
-
hasWorkToDo
public boolean hasWorkToDo()Description copied from class:AbstractEntityAICraftingIf the crafter should go in idle mode or not.- Overrides:
hasWorkToDoin classAbstractEntityAICrafting<JobPlanter,BuildingPlantation> - Returns:
- true if so.
-
canGoIdle
public boolean canGoIdle()Description copied from class:AbstractEntityAIBasicIf the worker currently has work to do or could also just wander around.- Overrides:
canGoIdlein classAbstractEntityAIBasic<JobPlanter,BuildingPlantation> - Returns:
- true if can go idle.
-