Interface GenericInternalInventory


@Experimental public interface GenericInternalInventory
Abstraction layer over the "generic" (meaning that it can accept any AEKey in each slot) inventory used by various AE2 devices. This is exposed to allow addons to adapt them for foreign capabilities/API lookups.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Start a new change notifications batch, deferring change notifications.
    boolean
     
    boolean
     
    void
    Finish the current batch and send any pending notification.
    void
    Finish the current batch and suppress any pending notification.
    long
    extract(int slot, AEKey what, long amount, Actionable mode)
    Try to extract something from a given slot.
    long
    getAmount(int slot)
     
    long
     
    @Nullable AEKey
    getKey(int slot)
     
    long
     
    @Nullable GenericStack
    getStack(int slot)
     
    long
    insert(int slot, AEKey what, long amount, Actionable mode)
    Try to insert something into a given slot.
    boolean
    Return true if the key would generally be allowed, ignoring the current state of the inventory.
    void
    Send a change notification manually, for example because the automatic notification was suppressed.
    void
    setStack(int slot, @Nullable GenericStack newStack)
     
    int
     
  • Method Details

    • size

      int size()
      Returns:
      The number of slots in this inventory. Never changes.
    • getStack

      @Nullable @Nullable GenericStack getStack(int slot)
    • getKey

      @Nullable @Nullable AEKey getKey(int slot)
    • getAmount

      long getAmount(int slot)
    • getMaxAmount

      long getMaxAmount(AEKey key)
      Returns:
      The key-specific max amount (for items this takes the max stack size into account).
    • getCapacity

      long getCapacity(AEKeyType keyType)
      Returns:
      The type-specific max amount (or an estimate if it depends on the stored item).
    • canInsert

      boolean canInsert()
    • canExtract

      boolean canExtract()
    • setStack

      void setStack(int slot, @Nullable @Nullable GenericStack newStack)
    • isAllowed

      boolean isAllowed(AEKey what)
      Return true if the key would generally be allowed, ignoring the current state of the inventory.
    • insert

      long insert(int slot, AEKey what, long amount, Actionable mode)
      Try to insert something into a given slot.
    • extract

      long extract(int slot, AEKey what, long amount, Actionable mode)
      Try to extract something from a given slot.
    • beginBatch

      void beginBatch()
      Start a new change notifications batch, deferring change notifications.
    • endBatch

      void endBatch()
      Finish the current batch and send any pending notification.
    • endBatchSuppressed

      void endBatchSuppressed()
      Finish the current batch and suppress any pending notification.
    • onChange

      void onChange()
      Send a change notification manually, for example because the automatic notification was suppressed.