Class DroneAIImExBase<W extends ProgWidgetInventoryBase>

java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
me.desht.pneumaticcraft.common.drone.ai.DroneAIBlockInteraction<W>
me.desht.pneumaticcraft.common.drone.ai.DroneAIImExBase<W>
All Implemented Interfaces:
IBlockInteractHandler
Direct Known Subclasses:
DroneAICustomBlockInteract, DroneAIDropItem, DroneAIEnergyExport, DroneAIEnergyImport, DroneAILiquidExport, DroneAILiquidImport, DroneEntityAIInventoryExport, DroneEntityAIInventoryImport

public abstract class DroneAIImExBase<W extends ProgWidgetInventoryBase> extends DroneAIBlockInteraction<W> implements IBlockInteractHandler
  • Constructor Details

    • DroneAIImExBase

      protected DroneAIImExBase(IDroneBase drone, W widget)
  • Method Details

    • canUse

      public boolean canUse()
      Description copied from class: DroneAIBlockInteraction
      Returns whether the EntityAIBase should begin execution.
      Overrides:
      canUse in class DroneAIBlockInteraction<W extends ProgWidgetInventoryBase>
    • decreaseCount

      public void decreaseCount(int count)
      Description copied from interface: IBlockInteractHandler
      When IBlockInteractHandler.useCount() returns true, this should be called to notify the amount actually transferred.
      Specified by:
      decreaseCount in interface IBlockInteractHandler
      Parameters:
      count - the amount to notify
    • getRemainingCount

      public int getRemainingCount()
      Description copied from interface: IBlockInteractHandler
      When IBlockInteractHandler.useCount() returns true, transfer only up to this much of the resource in question.
      Specified by:
      getRemainingCount in interface IBlockInteractHandler
      Returns:
      the maximum amount to attempt to transfer
    • doBlockInteraction

      protected boolean doBlockInteraction(net.minecraft.core.BlockPos pos, double squareDistToBlock)
      Description copied from class: DroneAIBlockInteraction
      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.
      Specified by:
      doBlockInteraction in class DroneAIBlockInteraction<W extends ProgWidgetInventoryBase>
      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
    • getSides

      public boolean[] getSides()
      Description copied from interface: IBlockInteractHandler
      Returns a boolean[6] of all sides, in order D,U,N,S,W,E; you can use Direction.get3DDataValue() to get an index into this array to get the facing direction, or you use the IBlockInteractHandler.isSideAccessible(Direction) convenience method.
      Specified by:
      getSides in interface IBlockInteractHandler
      Returns:
      an array of booleans indexed by the Direction index
    • useCount

      public boolean useCount()
      Description copied from interface: IBlockInteractHandler
      This is controlled by players setting the "Use Count" checkbox in the widget GUI. When true, the drone is trying to transfer a specific quantity of the resource in question (items/fluid/energy...).
      Specified by:
      useCount in interface IBlockInteractHandler
      Returns:
      true if a specific quantity should be imported/exported