Class AbstractEntityAIFight<J extends AbstractJobGuard<J>,B extends AbstractBuildingGuards>
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.guard.AbstractEntityAIFight<J,B>
- Type Parameters:
J- the generic job.
- All Implemented Interfaces:
ITickingStateAI
- Direct Known Subclasses:
AbstractEntityAIGuard
public abstract class AbstractEntityAIFight<J extends AbstractJobGuard<J>,B extends AbstractBuildingGuards>
extends AbstractEntityAIInteract<J,B>
Class taking of the abstract guard methods for both archer and knights.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of items that are required by the guard based on building level and guard level.static final doubleThe bonus speed per worker level.protected net.minecraft.world.entity.LivingEntityThe current target for our guard.final List<EquipmentTypeEntry>Tools and Items needed by the worker.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionState to go to after dumping.What to do after picking up a request.protected voidTask to do when at the own building, as guards only go there on requests and on dumpvoidRemoves currently equipped shieldvoidEquips armor existing in inventoryThe state to transform to after picking up things.protected IAIStateRedirects the guard to their building.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
cancelAsynchRequestForArmor, canGoIdle, checkAndTransferFromHut, checkForToolOrWeapon, checkForToolOrWeapon, checkForToolOrWeaponAsync, checkIfNeedsItem, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForTagExistOrCreateAsync, getActionsDoneUntilDumping, getBuildingToDump, getEffectiveSkillLevel, getExceptionTimer, getExpectedBuildingClass, getFakePlayer, getInventory, getInvertedEffectiveSkillLevel, getModuleForJob, getMostEfficientTool, getPrimarySkillLevel, getSecondarySkillLevel, 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
-
Field Details
-
toolsNeeded
Tools and Items needed by the worker. -
itemsNeeded
List of items that are required by the guard based on building level and guard level. This array holds a pointer to the building level and then pointer to GuardGear -
target
protected net.minecraft.world.entity.LivingEntity targetThe current target for our guard. -
SPEED_LEVEL_BONUS
public static final double SPEED_LEVEL_BONUSThe bonus speed per worker level.- See Also:
-
-
Constructor Details
-
AbstractEntityAIFight
Creates the abstract part of the AI. Always use this constructor!- Parameters:
job- the job to fulfill
-
-
Method Details
-
startWorkingAtOwnBuilding
Redirects the guard to their building.- Returns:
- The next
IAIState.
-
afterRequestPickUp
Description copied from class:AbstractEntityAIBasicWhat to do after picking up a request.- Overrides:
afterRequestPickUpin classAbstractEntityAIBasic<J extends AbstractJobGuard<J>,B extends AbstractBuildingGuards> - Returns:
- the next state to go to.
-
getStateAfterPickUp
Description copied from class:AbstractEntityAIBasicThe state to transform to after picking up things.- Overrides:
getStateAfterPickUpin classAbstractEntityAIBasic<J extends AbstractJobGuard<J>,B extends AbstractBuildingGuards> - Returns:
- the next state to go to.
-
atBuildingActions
protected void atBuildingActions()Task to do when at the own building, as guards only go there on requests and on dump -
afterDump
Description copied from class:AbstractEntityAIBasicState to go to after dumping.- Overrides:
afterDumpin classAbstractEntityAIBasic<J extends AbstractJobGuard<J>,B extends AbstractBuildingGuards> - Returns:
- the next state.
-
equipInventoryArmor
public void equipInventoryArmor()Equips armor existing in inventory -
cleanVisibleSlots
public void cleanVisibleSlots()Removes currently equipped shield
-