Interface IBlockInteractHandler

All Known Implementing Classes:
DroneAICustomBlockInteract, DroneAIDropItem, DroneAIEnergyExport, DroneAIEnergyImport, DroneAIImExBase, DroneAILiquidExport, DroneAILiquidImport, DroneEntityAIInventoryExport, DroneEntityAIInventoryImport

public interface IBlockInteractHandler
This represents the drone's AI interaction handler. DON'T IMPLEMENT THIS, just use it when passed to ICustomBlockInteract.doInteract(BlockPos, IDrone, IBlockInteractHandler, boolean).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    When invoked, the drone will abort searching the area.
    void
    decreaseCount(int count)
    When useCount() returns true, this should be called to notify the amount actually transferred.
    int
    When useCount() returns true, transfer only up to this much of the resource in question.
    boolean[]
    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 isSideAccessible(Direction) convenience method.
    default boolean
    isSideAccessible(net.minecraft.core.Direction face)
    Convenience method to check if a given face is accessible.
    boolean
    This is controlled by players setting the "Use Count" checkbox in the widget GUI.
  • Method Details

    • getSides

      boolean[] getSides()
      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 isSideAccessible(Direction) convenience method.
      Returns:
      an array of booleans indexed by the Direction index
    • useCount

      boolean useCount()
      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...).
      Returns:
      true if a specific quantity should be imported/exported
    • decreaseCount

      void decreaseCount(int count)
      When useCount() returns true, this should be called to notify the amount actually transferred.
      Parameters:
      count - the amount to notify
    • getRemainingCount

      int getRemainingCount()
      When useCount() returns true, transfer only up to this much of the resource in question.
      Returns:
      the maximum amount to attempt to transfer
    • abort

      void abort()
      When invoked, the drone will abort searching the area. Could be used to abort early when full of RF energy for example, when importing RF. (It's useless to search any further)
    • isSideAccessible

      default boolean isSideAccessible(net.minecraft.core.Direction face)
      Convenience method to check if a given face is accessible.
      Parameters:
      face - the face to check
      Returns:
      true if the face is accessible