Class EntityAIWorkDeliveryman
java.lang.Object
com.minecolonies.core.entity.ai.workers.AbstractAISkeleton<JobDeliveryman>
com.minecolonies.core.entity.ai.workers.AbstractEntityAIBasic<JobDeliveryman,BuildingDeliveryman>
com.minecolonies.core.entity.ai.workers.AbstractEntityAISkill<JobDeliveryman,BuildingDeliveryman>
com.minecolonies.core.entity.ai.workers.AbstractEntityAIInteract<JobDeliveryman,BuildingDeliveryman>
com.minecolonies.core.entity.ai.workers.service.EntityAIWorkDeliveryman
- All Implemented Interfaces:
ITickingStateAI
public class EntityAIWorkDeliveryman
extends AbstractEntityAIInteract<JobDeliveryman,BuildingDeliveryman>
Delivers item at needs.
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionEntityAIWorkDeliveryman(@NotNull JobDeliveryman deliveryman) Initialize the deliveryman and add all his tasks. -
Method Summary
Modifier and TypeMethodDescriptionbooleangatherIfInTileEntity(net.minecraft.world.level.block.entity.BlockEntity entity, net.minecraft.world.item.ItemStack is) Finds the first @see ItemStack the type ofis.Can be overridden in implementations to return the exact building type the worker expects.protected voidCan be overridden in implementations.static intworkerRequiresItem(IBuilding building, net.minecraft.world.item.ItemStack stack, List<ItemStorage> localAlreadyKept) Check if worker of a certain building requires the item now.Methods inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIInteract
fillItemsList, gatherItems, getBlockMiningTime, getBreakSpeedLevel, getItemsForPickUp, increaseBlockDrops, isItemWorthPickingUp, mineBlock, mineBlock, mineBlock, onBlockDropReception, resetGatheringItems, searchForItems, shouldSilkTouchBlock, triggerMinedBlockMethods 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, getActionsDoneUntilDumping, 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_BACKPACK
Render meta backpack.- See Also:
-
-
Constructor Details
-
EntityAIWorkDeliveryman
Initialize the deliveryman and add all his tasks.- Parameters:
deliveryman- the job he has.
-
-
Method Details
-
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 classAbstractEntityAIBasic<JobDeliveryman,BuildingDeliveryman>
-
getExpectedBuildingClass
Description copied from class:AbstractEntityAIBasicCan be overridden in implementations to return the exact building type the worker expects.- Specified by:
getExpectedBuildingClassin classAbstractEntityAIBasic<JobDeliveryman,BuildingDeliveryman> - Returns:
- the building type associated with this AI's worker.
-
workerRequiresItem
public static int workerRequiresItem(IBuilding building, net.minecraft.world.item.ItemStack stack, List<ItemStorage> localAlreadyKept) Check if worker of a certain building requires the item now. Or the builder for the current task.- Parameters:
building- the building to check for.stack- the stack to stack with.localAlreadyKept- already kept resources.- Returns:
- the amount which can get dumped.
-
gatherIfInTileEntity
public boolean gatherIfInTileEntity(net.minecraft.world.level.block.entity.BlockEntity entity, net.minecraft.world.item.ItemStack is) Finds the first @see ItemStack the type ofis. It will be taken from the chest and placed in the worker inventory. Make sure that the worker stands next the chest to not break immersion. Also make sure to have inventory space for the stack.- Parameters:
entity- the tileEntity chest or building or rack.is- the itemStack.- Returns:
- true if found the stack.
-