Class DroneAIPlace<W extends ProgWidgetAreaItemBase>
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
me.desht.pneumaticcraft.common.ai.DroneAIBlockInteraction<W>
me.desht.pneumaticcraft.common.ai.DroneAIPlace<W>
-
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 inherited from class me.desht.pneumaticcraft.common.ai.DroneAIBlockInteraction
drone, progWidget -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoBlockInteraction(net.minecraft.core.BlockPos pos, double squareDistToBlock) Carry out the actual interaction operation.protected 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 byDroneAIBlockInteraction.doBlockInteraction(BlockPos, double)should be attempted as a simulation.protected booleanMethods inherited from class me.desht.pneumaticcraft.common.ai.DroneAIBlockInteraction
abort, addEndingDebugEntry, canContinueToUse, canUse, moveIntoBlock, moveToPositions, setMaxActionsMethods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, getFlags, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, start, stop, tick, toString
-
Constructor Details
-
DroneAIPlace
- Parameters:
drone- the dronewidget- needs to implement IBlockOrdered as well as ProgWidgetAreaItemBase
-
-
Method Details
-
respectClaims
protected boolean respectClaims()- Overrides:
respectClaimsin classDroneAIBlockInteraction<W extends ProgWidgetAreaItemBase>
-
isValidPosition
protected boolean isValidPosition(net.minecraft.core.BlockPos pos) Description copied from class:DroneAIBlockInteractionCheck if the given blockpos is valid for the purposes of this operation; generally the operation that is carried out byDroneAIBlockInteraction.doBlockInteraction(BlockPos, double)should be attempted as a simulation. If this method returns true, then the drone will attempt to move there (if appropriate) and callDroneAIBlockInteraction.doBlockInteraction(BlockPos, double)to actually carry out the operation.- Specified by:
isValidPositionin classDroneAIBlockInteraction<W extends ProgWidgetAreaItemBase>- Parameters:
pos- the block pos to examine- Returns:
- true if this pos is valid, false otherwise
-
doBlockInteraction
protected boolean doBlockInteraction(net.minecraft.core.BlockPos pos, double squareDistToBlock) Description copied from class:DroneAIBlockInteractionCarry 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.- Specified by:
doBlockInteractionin classDroneAIBlockInteraction<W extends ProgWidgetAreaItemBase>- 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
-