Interface IBasicCellItem

All Superinterfaces:
ICellWorkbenchItem, net.minecraft.world.level.ItemLike, IUpgradeableItem

public interface IBasicCellItem extends ICellWorkbenchItem
Implement this on any item to register a "basic cell", which is a cell that works similarly to AE2's own item and fluid cells. There is no need to register an ICellHandler for such an item. AE2 automatically handles the internals and NBT data, which is both nice, and bad for you!

The standard AE implementation also only provides 1-63 Types.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addCellInformationToTooltip(net.minecraft.world.item.ItemStack is, List<net.minecraft.network.chat.Component> lines)
    Convenient helper to append useful tooltip information.
    int
    getBytes(net.minecraft.world.item.ItemStack cellItem)
    The number of bytes that can be stored on this type of storage cell.
    int
    getBytesPerType(net.minecraft.world.item.ItemStack cellItem)
    Determines the number of bytes used for any type included on the cell.
    appeng.util.ConfigInventory
    getConfigInventory(net.minecraft.world.item.ItemStack is)
    Used to extract, or mirror the contents of the work bench onto the cell.
    double
     
    Basic cell items are limited to a single AEKeyType.
    int
    getTotalTypes(net.minecraft.world.item.ItemStack cellItem)
    Must be between 1 and 63, indicates how many types can be stored on this type of storage cell.
    default boolean
    isBlackListed(net.minecraft.world.item.ItemStack cellItem, AEKey requestedAddition)
    Allows you to fine tune which items are allowed on a given cell, if you don't care, just return false; As the handler for this type of cell is still the default cells, the normal AE black list is also applied.
    default boolean
    isStorageCell(net.minecraft.world.item.ItemStack i)
    Allows an item to selectively enable or disable its status as a storage cell.
    default boolean
    Allows you to specify if this storage cell can be stored inside other storage cells, only set this for special items like the matter cannon that are not general purpose storage.

    Methods inherited from interface appeng.api.storage.cells.ICellWorkbenchItem

    getFuzzyMode, isEditable, setFuzzyMode

    Methods inherited from interface net.minecraft.world.level.ItemLike

    asItem

    Methods inherited from interface appeng.api.upgrades.IUpgradeableItem

    getUpgrades
  • Method Details

    • getKeyType

      AEKeyType getKeyType()
      Basic cell items are limited to a single AEKeyType.
    • getBytes

      int getBytes(net.minecraft.world.item.ItemStack cellItem)
      The number of bytes that can be stored on this type of storage cell.

      It wont work if the return is not a multiple of 8. The limit is (Integer.MAX_VALUE + 1) / 8.

      Parameters:
      cellItem - item
      Returns:
      number of bytes
    • getBytesPerType

      int getBytesPerType(net.minecraft.world.item.ItemStack cellItem)
      Determines the number of bytes used for any type included on the cell.
      Parameters:
      cellItem - item
      Returns:
      number of bytes
    • getTotalTypes

      int getTotalTypes(net.minecraft.world.item.ItemStack cellItem)
      Must be between 1 and 63, indicates how many types can be stored on this type of storage cell.
      Parameters:
      cellItem - item
      Returns:
      number of types
    • isBlackListed

      default boolean isBlackListed(net.minecraft.world.item.ItemStack cellItem, AEKey requestedAddition)
      Allows you to fine tune which items are allowed on a given cell, if you don't care, just return false; As the handler for this type of cell is still the default cells, the normal AE black list is also applied.
      Parameters:
      cellItem - item
      requestedAddition - requested addition
      Returns:
      true to preventAdditionOfItem
    • storableInStorageCell

      default boolean storableInStorageCell()
      Allows you to specify if this storage cell can be stored inside other storage cells, only set this for special items like the matter cannon that are not general purpose storage.
      Returns:
      true if the storage cell can be stored inside other storage cells, this is generally false, except for certain situations such as the matter cannon.
    • isStorageCell

      default boolean isStorageCell(net.minecraft.world.item.ItemStack i)
      Allows an item to selectively enable or disable its status as a storage cell.
      Parameters:
      i - item
      Returns:
      if the ItemStack should currently be usable as a storage cell.
    • getIdleDrain

      double getIdleDrain()
      Returns:
      drain in ae/t this storage cell will use.
    • getConfigInventory

      appeng.util.ConfigInventory getConfigInventory(net.minecraft.world.item.ItemStack is)
      Description copied from interface: ICellWorkbenchItem
      Used to extract, or mirror the contents of the work bench onto the cell.

      - This should have exactly 63 slots, any more, or less might cause issues.

      onInventoryChange will be called when saving is needed.

      Specified by:
      getConfigInventory in interface ICellWorkbenchItem
    • addCellInformationToTooltip

      default void addCellInformationToTooltip(net.minecraft.world.item.ItemStack is, List<net.minecraft.network.chat.Component> lines)
      Convenient helper to append useful tooltip information.