Class DroneAIBlockInteraction<W extends ProgWidgetAreaItemBase>

java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
me.desht.pneumaticcraft.common.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
    Modifier and Type
    Field
    Description
    protected final IDroneBase
     
    protected final W
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DroneAIBlockInteraction(IDroneBase drone, W progWidget)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    boolean
    Returns whether an in-progress EntityAIBase should continue executing
    boolean
    Returns whether the EntityAIBase should begin execution.
    protected abstract boolean
    doBlockInteraction(net.minecraft.core.BlockPos pos, double squareDistToBlock)
    Carry out the actual interaction operation.
    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 by doBlockInteraction(BlockPos, double) should be attempted as a simulation.
    protected boolean
     
    protected boolean
     
    protected boolean
     
    setMaxActions(int maxActions)
     

    Methods inherited from class net.minecraft.world.entity.ai.goal.Goal

    adjustedTickDelay, getFlags, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, start, stop, tick, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • DroneAIBlockInteraction

      public DroneAIBlockInteraction(IDroneBase drone, W progWidget)
      Parameters:
      drone - the drone
      progWidget - needs to implement IBlockOrdered
  • Method Details

    • canUse

      public boolean canUse()
      Returns whether the EntityAIBase should begin execution.
      Specified by:
      canUse in class net.minecraft.world.entity.ai.goal.Goal
    • setMaxActions

      public DroneAIBlockInteraction<?> setMaxActions(int maxActions)
    • 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 by 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 call doBlockInteraction(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 on
      squareDistToBlock - 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:
      canContinueToUse in class net.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()