Class AbstractEntityAIStructureWithWorkOrder<J extends AbstractJobStructure<?,J>,B extends AbstractBuildingStructureBuilder>
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.AbstractEntityAIStructure<J,B>
com.minecolonies.core.entity.ai.workers.AbstractEntityAIStructureWithWorkOrder<J,B>
- All Implemented Interfaces:
ITickingStateAI
- Direct Known Subclasses:
EntityAIQuarrier,EntityAIStructureBuilder,EntityAIStructureMiner
public abstract class AbstractEntityAIStructureWithWorkOrder<J extends AbstractJobStructure<?,J>,B extends AbstractBuildingStructureBuilder>
extends AbstractEntityAIStructure<J,B>
AI class for the builder. Manages building and repairing buildings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumPossible request stagesNested classes/interfaces inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIStructure
AbstractEntityAIStructure.ItemCheckResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected net.minecraft.core.BlockPosRequest progress pos.The current request state (0 is solidFields inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIStructure
blockToMine, BUILD_BLOCK_DELAY, DONT_TOUCH_PREDICATE, gotoPos, limitReached, loadingBlueprint, prevBlockPosition, structurePlacer, workFromFields 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
ConstructorsConstructorDescriptionInitialize the builder and add all his tasks. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanCheck if the structure tusk has been canceled.protected booleanCheck ifvoidExecute specific actions on loading a structure.Tuple<net.minecraft.core.BlockPos,BuildingProgressStage> Get the current structure progress,@Nullable net.minecraft.world.item.ItemStackgetTotalAmount(@Nullable net.minecraft.world.item.ItemStack stack) Check how much of a certain stuck is actually required.intgetTotalRequiredAmount(net.minecraft.world.item.ItemStack deliveredItemStack) Get the total amount required for an itemStack.voidSpecific actions to handle a cancellation of a structure.protected booleanLet childs overwrite this if necessary.Takes the existing workorder, loads the structure and tests the worker order if it is valid.voidreduceNeededResources(net.minecraft.world.item.ItemStack stack) Reduces the needed resources by 1.voidregisterBlockAsNeeded(net.minecraft.world.item.ItemStack stack) Register the block as needed at the building if possible.booleanIterates through all the required resources and stores them in the building.protected voidSend a completion message to the colony if necessary.voidstoreProgressPos(net.minecraft.core.BlockPos blockPos, BuildingProgressStage stage) Store the progressPos in the building if possible for the worker.Methods inherited from class com.minecolonies.core.entity.ai.workers.AbstractEntityAIStructure
afterDump, afterRequestPickUp, afterStructureLoading, checkForExtraBuildingActions, completeBuild, doMining, getCurrentBuildingPosition, getCurrentWorkingPosition, getPlaceSpeedLevel, getPosToWorkAt, getSolidSubstitution, getStateAfterPickUp, getWorker, getWorkingPosition, goToNextStage, hasListOfResInInvOrRequest, isBlockFree, isDecoItem, isThereAStructureToBuild, loadStructure, pickUpMaterial, resetCurrentStructure, setStructurePlacer, shallReplaceSolidSubstitutionBlock, skipBuilding, skipClearing, startBuilding, startWorkingAtOwnBuilding, structureStep, walkToConstructionSiteMethods 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, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreate, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForItemExistOrCreateAsync, checkIfRequestForTagExistOrCreateAsync, getActionsDoneUntilDumping, getBuildingToDump, getEffectiveSkillLevel, getExceptionTimer, getExpectedBuildingClass, getFakePlayer, getInventory, getInvertedEffectiveSkillLevel, getModuleForJob, getMostEfficientTool, getPrimarySkillLevel, getSecondarySkillLevel, 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
-
requestState
The current request state (0 is solid -
requestProgress
protected net.minecraft.core.BlockPos requestProgressRequest progress pos.
-
-
Constructor Details
-
AbstractEntityAIStructureWithWorkOrder
Initialize the builder and add all his tasks.- Parameters:
job- the job he has.
-
-
Method Details
-
storeProgressPos
Description copied from class:AbstractEntityAIStructureStore the progressPos in the building if possible for the worker.- Overrides:
storeProgressPosin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Parameters:
blockPos- the progressResult.stage- the current stage.
-
getProgressPos
Description copied from class:AbstractEntityAIStructureGet the current structure progress,- Specified by:
getProgressPosin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Returns:
- the progress with the current stage.
-
loadRequirements
Takes the existing workorder, loads the structure and tests the worker order if it is valid.- Overrides:
loadRequirementsin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Returns:
- the next state to go to.
-
checkIfNeedsItem
protected boolean checkIfNeedsItem()Description copied from class:AbstractEntityAIBasicCheck if- Overrides:
checkIfNeedsItemin classAbstractEntityAIBasic<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Returns:
-
requestMaterials
public boolean requestMaterials()Description copied from class:AbstractEntityAIStructureIterates through all the required resources and stores them in the building.- Overrides:
requestMaterialsin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Returns:
- true if finished.
-
registerBlockAsNeeded
public void registerBlockAsNeeded(net.minecraft.world.item.ItemStack stack) Description copied from class:AbstractEntityAIStructureRegister the block as needed at the building if possible.- Overrides:
registerBlockAsNeededin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Parameters:
stack- the stack.
-
getTotalRequiredAmount
public int getTotalRequiredAmount(net.minecraft.world.item.ItemStack deliveredItemStack) Description copied from class:AbstractEntityAIBasicGet the total amount required for an itemStack. Workers have to override this if they have more information.- Overrides:
getTotalRequiredAmountin classAbstractEntityAIBasic<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Parameters:
deliveredItemStack- the required stack.- Returns:
- on default the size of the stack.
-
executeSpecificCompleteActions
public void executeSpecificCompleteActions()Description copied from class:AbstractEntityAIStructureExecute specific actions on loading a structure.- Specified by:
executeSpecificCompleteActionsin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder>
-
sendCompletionMessage
Send a completion message to the colony if necessary.- Parameters:
wo- the completed workorder.
-
reduceNeededResources
public void reduceNeededResources(net.minecraft.world.item.ItemStack stack) Description copied from class:AbstractEntityAIStructureReduces the needed resources by 1.- Overrides:
reduceNeededResourcesin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Parameters:
stack- the stack which has been used now.
-
checkIfCanceled
protected boolean checkIfCanceled()Description copied from class:AbstractEntityAIStructureCheck if the structure tusk has been canceled.- Specified by:
checkIfCanceledin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Returns:
- true if reset to idle.
-
isAlreadyCleared
protected boolean isAlreadyCleared()Description copied from class:AbstractEntityAIStructureLet childs overwrite this if necessary.- Overrides:
isAlreadyClearedin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Returns:
- true if so.
-
getTotalAmount
@Nullable public @Nullable net.minecraft.world.item.ItemStack getTotalAmount(@Nullable @Nullable net.minecraft.world.item.ItemStack stack) Check how much of a certain stuck is actually required.- Overrides:
getTotalAmountin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder> - Parameters:
stack- the stack to check.- Returns:
- the new stack with the correct amount.
-
handleSpecificCancelActions
public void handleSpecificCancelActions()Description copied from class:AbstractEntityAIStructureSpecific actions to handle a cancellation of a structure.- Overrides:
handleSpecificCancelActionsin classAbstractEntityAIStructure<J extends AbstractJobStructure<?,J>, B extends AbstractBuildingStructureBuilder>
-