Class DroneAIBlockInteraction<W extends ProgWidgetAreaItemBase>
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
me.desht.pneumaticcraft.common.drone.ai.DroneAIBlockInteraction<W>
- Direct Known Subclasses:
DroneAIBlockCondition,DroneAIDig,DroneAIEditSign,DroneAIEntityExport,DroneAIExternalProgram,DroneAIForEachCoordinate,DroneAIHarvest,DroneAIImExBase,DroneAIPlace,DroneAIRightClickBlock
public abstract class DroneAIBlockInteraction<W extends ProgWidgetAreaItemBase>
extends net.minecraft.world.entity.ai.goal.Goal
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.Goal.Flag -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()protected voidbooleanReturns whether an in-progress EntityAIBase should continue executingbooleancanUse()Returns whether the EntityAIBase should begin execution.protected abstract booleandoBlockInteraction(net.minecraft.core.BlockPos pos, double squareDistToBlock) Carry out the actual interaction operation.protected abstract booleanisValidPosition(net.minecraft.core.BlockPos pos) Check if the given blockpos is valid for the purposes of this operation; generally the operation that is carried out bydoBlockInteraction(BlockPos, double)should be attempted as a simulation.protected booleanprotected booleanprotected booleansetMaxActions(int maxActions) Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, getFlags, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, start, stop, tick, toString
-
Field Details
-
drone
-
progWidget
-
-
Constructor Details
-
DroneAIBlockInteraction
- Parameters:
drone- the droneprogWidget- needs to implement IBlockOrdered
-
-
Method Details
-
canUse
public boolean canUse()Returns whether the EntityAIBase should begin execution.- Specified by:
canUsein classnet.minecraft.world.entity.ai.goal.Goal
-
setMaxActions
-
isValidPosition
protected abstract boolean isValidPosition(net.minecraft.core.BlockPos pos) Check if the given blockpos is valid for the purposes of this operation; generally the operation that is carried out bydoBlockInteraction(BlockPos, double)should be attempted as a simulation. If this method returns true, then the drone will attempt to move there (if appropriate) and calldoBlockInteraction(BlockPos, double)to actually carry out the operation.- Parameters:
pos- the block pos to examine- Returns:
- true if this pos is valid, false otherwise
-
doBlockInteraction
protected abstract boolean doBlockInteraction(net.minecraft.core.BlockPos pos, double squareDistToBlock) Carry out the actual interaction operation. Beware the return value: returning false is usually the right thing to do when the operation succeeded, to indicate to the drone that it shouldn't keep trying this, but instead move on to the next progwidget.- Parameters:
pos- the block pos to work onsquareDistToBlock- squared distance from the drone to the block- Returns:
- false if we're done and should stop trying, true to try again next time
-
canContinueToUse
public boolean canContinueToUse()Returns whether an in-progress EntityAIBase should continue executing- Overrides:
canContinueToUsein classnet.minecraft.world.entity.ai.goal.Goal
-
addEndingDebugEntry
protected void addEndingDebugEntry() -
respectClaims
protected boolean respectClaims() -
moveIntoBlock
protected boolean moveIntoBlock() -
abort
public void abort() -
moveToPositions
protected boolean moveToPositions()
-