Class EntityAICavalry
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>
com.minecolonies.core.entity.ai.workers.guard.AbstractEntityAIGuard<JobCavalry,AbstractBuildingGuards>
com.minecolonies.core.entity.ai.workers.guard.EntityAICavalry
- All Implemented Interfaces:
ITickingStateAI
Cavalry AI
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected net.minecraft.core.BlockPosprotected CavalryHorseEntityFields inherited from class com.minecolonies.core.entity.ai.workers.guard.AbstractEntityAIGuard
buildingGuards, COMBAT_TIME, currentPatrolPoint, fighttimer, PATROL_DEVIATION_RAID_POINT, sleepingGuard, target, wakeTimerFields inherited from class com.minecolonies.core.entity.ai.workers.guard.AbstractEntityAIFight
itemsNeeded, SPEED_LEVEL_BONUS, toolsNeededFields 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 TypeMethodDescriptionbooleancanHelp(net.minecraft.core.BlockPos pos) Check if we can help a citizenprotected IAIStatedecide()Decides the AI state the citizen should be in, and transitions as necessary.protected IAIStateFinds a horse to ride.protected @Nullable CavalryHorseEntityFinds the nearest horse to the worker that is available for riding.protected IAIStateFind a stable that might have available horses within range.protected @NotNull List<ItemStorage>Adds a shield to the list of items that are nice to have if the shield usage research is enabled.patrol()Patrol between a list of patrol points.protected IAIStatesleep()Sleep activity If the guard is mounted, dismounts and clears the horse of the guard's reservation.Methods inherited from class com.minecolonies.core.entity.ai.workers.guard.AbstractEntityAIGuard
canBeInterrupted, getActionsDoneUntilDumping, getCurrentPatrolPoint, getExpectedBuildingClass, getJob, getPersecutionDistance, guardMovement, hasTool, isAttackableTarget, isWithinPersecutionDistance, patrolMine, randomPatrolPoint, setWakeCitizen, startHelpCitizen, startWorkingAtOwnBuilding, stopSleepingMethods inherited from class com.minecolonies.core.entity.ai.workers.guard.AbstractEntityAIFight
afterDump, afterRequestPickUp, atBuildingActions, cleanVisibleSlots, equipInventoryArmor, getStateAfterPickUpMethods 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, getBuildingToDump, getEffectiveSkillLevel, getExceptionTimer, getFakePlayer, getInventory, getInvertedEffectiveSkillLevel, getModuleForJob, getMostEfficientTool, getPrimarySkillLevel, getSecondarySkillLevel, getTotalRequiredAmount, getWorkingPosition, getWorkingPosition, hasNotDelayed, holdEfficientTool, incrementActionsDone, incrementActionsDone, incrementActionsDoneAndDecSaturation, inventoryNeedsDump, isAfterDumpPickupAllowed, 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
getState, getStateAI, getTickRate, onRemoval, registerGroupTarget, registerTarget, registerTargets, resetAI, setCurrentDelay, tick
-
Field Details
-
targetMount
-
stablePos
protected net.minecraft.core.BlockPos stablePos -
stableChecked
protected boolean stableChecked
-
-
Constructor Details
-
EntityAICavalry
-
-
Method Details
-
decide
Decides the AI state the citizen should be in, and transitions as necessary. If the guard isn't mounted, will transition to the mount finding state. Otherwise, will call the super decide method.- Overrides:
decidein classAbstractEntityAIGuard<JobCavalry,AbstractBuildingGuards> - Returns:
- the next AI state.
-
sleep
Sleep activity If the guard is mounted, dismounts and clears the horse of the guard's reservation.- Overrides:
sleepin classAbstractEntityAIGuard<JobCavalry,AbstractBuildingGuards> - Returns:
- the next state to go into
-
findStable
Find a stable that might have available horses within range.- Returns:
- the next AI state.
-
findMount
Finds a horse to ride. If the horse is already assigned, ride it. Otherwise, find the closest horse and assign it to the guard. If no horse is found, return NO_TARGET. If the guard can't reach the horse, return FIND_MOUNT to try again.- Returns:
- the next state to go to.
-
patrol
Patrol between a list of patrol points.- Overrides:
patrolin classAbstractEntityAIGuard<JobCavalry,AbstractBuildingGuards> - Returns:
- the next patrol point to go to.
-
findNearestHorse
Finds the nearest horse to the worker that is available for riding. If a horse is found that is reserved by the worker, it is prioritized over other available horses.- Returns:
- the nearest available horse, or null if none are found
-
itemsNiceToHave
Adds a shield to the list of items that are nice to have if the shield usage research is enabled.- Overrides:
itemsNiceToHavein classAbstractEntityAIBasic<JobCavalry,AbstractBuildingGuards> - Returns:
- the list of items nice to have.
-
canHelp
public boolean canHelp(net.minecraft.core.BlockPos pos) Check if we can help a citizen- Overrides:
canHelpin classAbstractEntityAIGuard<JobCavalry,AbstractBuildingGuards> - Parameters:
pos-- Returns:
- true if not fighting/helping already
-