Class EntityAIWorkBeekeeper
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<JobBeekeeper,BuildingBeekeeper>
com.minecolonies.core.entity.ai.workers.production.agriculture.EntityAIWorkBeekeeper
- All Implemented Interfaces:
ITickingStateAI
Beekeeper AI class.
-
Field Summary
Fields 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
ConstructorsConstructorDescriptionEntityAIWorkBeekeeper(@NotNull JobBeekeeper job) Creates the abstract part of the AI. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequipBreedItem(net.minecraft.world.InteractionHand hand) Sets theItemStackas held item or returns false.booleanequipItem(net.minecraft.world.InteractionHand hand, net.minecraft.world.item.ItemStack itemStack) Sets theItemStackas held item or returns false.booleanequipTool(net.minecraft.world.InteractionHand hand, EquipmentTypeEntry toolType) Sets the tool as held item.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.intgetItemSlot(net.minecraft.world.item.Item item) Gets the slot in which the inserted item is in.static List<net.minecraft.world.entity.animal.Bee>searchForAnimals(net.minecraft.world.level.Level world, BuildingBeekeeper ownBuilding) Find animals in area.booleanwalkingToAnimal(net.minecraft.world.entity.animal.Animal animal) Lets the herder walk to the animal.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, 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, updateRenderMetaData, 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
-
Constructor Details
-
EntityAIWorkBeekeeper
Creates the abstract part of the AI. Always use this constructor!- Parameters:
job- the job to fulfill
-
-
Method Details
-
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<JobBeekeeper,BuildingBeekeeper> - Returns:
- the number of actions done before item dump.
-
walkingToAnimal
public boolean walkingToAnimal(net.minecraft.world.entity.animal.Animal animal) Lets the herder walk to the animal.- Parameters:
animal- the animal to walk to.- Returns:
- false if the herder is walking to the animal.
-
equipTool
Sets the tool as held item.- Parameters:
toolType- theEquipmentTypeEntrywe want to equiphand- the hand to equip it in.- Returns:
- true if the tool was equipped.
-
equipItem
public boolean equipItem(net.minecraft.world.InteractionHand hand, net.minecraft.world.item.ItemStack itemStack) Sets theItemStackas held item or returns false.- Parameters:
itemStack- theItemStackto equip.hand- the hand to equip it in.- Returns:
- true if the item was equipped.
-
equipBreedItem
public boolean equipBreedItem(net.minecraft.world.InteractionHand hand) Sets theItemStackas held item or returns false.- Parameters:
hand- the hand to equip it in.- Returns:
- true if the item was equipped.
-
getItemSlot
public int getItemSlot(net.minecraft.world.item.Item item) Gets the slot in which the inserted item is in. (if any).- Parameters:
item- TheItemto check for.- Returns:
- slot number -1 if not in INV.
-
searchForAnimals
public static List<net.minecraft.world.entity.animal.Bee> searchForAnimals(net.minecraft.world.level.Level world, BuildingBeekeeper ownBuilding) Find animals in area.- Returns:
- the
Listof animals in the area.
-
getExpectedBuildingClass
Can be overridden in implementations to return the exact building type the worker expects.- Specified by:
getExpectedBuildingClassin classAbstractEntityAIBasic<JobBeekeeper,BuildingBeekeeper> - Returns:
- the building type associated with this AI's worker.
-