Class EntityAIWorkFlorist
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<JobFlorist,BuildingFlorist>
com.minecolonies.core.entity.ai.workers.production.agriculture.EntityAIWorkFlorist
- All Implemented Interfaces:
ITickingStateAI
Florist AI class.
-
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
ConstructorsConstructorDescriptionEntityAIWorkFlorist(@NotNull JobFlorist job) Creates the abstract part of the AI. -
Method Summary
Modifier and TypeMethodDescriptionprotected intCalculates after how many actions the ai should dump it's inventory.intgetBlockMiningTime(@NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.core.BlockPos pos) Calculate how long it takes to mine this block.Can be overridden in implementations to return the exact building type the worker expects.getFlowerDropAtPos(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Retrieves the item registry name of the first flower drop at the specified position.booleanholdEfficientTool(@NotNull net.minecraft.world.level.block.state.BlockState target, net.minecraft.core.BlockPos pos) Check and ensure that we hold the most efficient tool for the job.protected voidCan be overridden in implementations.Methods inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIInteract
fillItemsList, gatherItems, 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, getBuildingToDump, getEffectiveSkillLevel, getExceptionTimer, getFakePlayer, getInventory, getInvertedEffectiveSkillLevel, getModuleForJob, getMostEfficientTool, getPrimarySkillLevel, getSecondarySkillLevel, getStateAfterPickUp, getTotalRequiredAmount, getWorkingPosition, getWorkingPosition, hasNotDelayed, 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_FLOWERS
Flower meta data.- See Also:
-
-
Constructor Details
-
EntityAIWorkFlorist
Creates the abstract part of the AI. Always use this constructor!- Parameters:
job- the job to fulfill
-
-
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<JobFlorist,BuildingFlorist>
-
holdEfficientTool
public boolean holdEfficientTool(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState target, net.minecraft.core.BlockPos pos) Description copied from class:AbstractEntityAIBasicCheck and ensure that we hold the most efficient tool for the job.If we have no tool for the job, we will request on, return immediately.
- Overrides:
holdEfficientToolin classAbstractEntityAIBasic<JobFlorist,BuildingFlorist> - Parameters:
target- the BlockState to minepos- the pos to mine- Returns:
- true if we have a tool for the job
-
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<JobFlorist,BuildingFlorist> - Returns:
- the number of actions done before item dump.
-
getBlockMiningTime
public int getBlockMiningTime(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull @NotNull net.minecraft.core.BlockPos pos) Calculate how long it takes to mine this block.- Overrides:
getBlockMiningTimein classAbstractEntityAIInteract<JobFlorist,BuildingFlorist> - Parameters:
state- the blockstatepos- coordinate- Returns:
- the delay in ticks
-
getExpectedBuildingClass
Description copied from class:AbstractEntityAIBasicCan be overridden in implementations to return the exact building type the worker expects.- Specified by:
getExpectedBuildingClassin classAbstractEntityAIBasic<JobFlorist,BuildingFlorist> - Returns:
- the building type associated with this AI's worker.
-
getFlowerDropAtPos
protected List<String> getFlowerDropAtPos(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Retrieves the item registry name of the first flower drop at the specified position.- Parameters:
world- the world in which to check for flower drops.pos- the position to check for flower drops.- Returns:
- an Optional containing the registry name of the flower drop, or an empty Optional if no flower is found.
-