Class StorageCells

java.lang.Object
appeng.api.storage.StorageCells

public final class StorageCells extends Object
Storage Cell Registry, used for specially implemented cells, if you just want to make a item act like a cell, or new cell with different bytes, you should probably consider implementing IBasicCellItem on your item instead.
  • Method Details

    • addCellHandler

      public static void addCellHandler(ICellHandler handler)
      Register a new handler.

      Never be call before FMLCommonSetupEvent was handled by AE2. Will throw an exception otherwise.

      Parameters:
      handler - cell handler
    • addCellGuiHandler

      public static void addCellGuiHandler(ICellGuiHandler handler)
      Register a new handler
      Parameters:
      handler - cell gui handler
    • isCellHandled

      public static boolean isCellHandled(net.minecraft.world.item.ItemStack is)
      return true, if you can get a InventoryHandler for the item passed.
      Parameters:
      is - to be checked item
      Returns:
      true if the provided item, can be handled by a handler in AE, ( AE May choose to skip this and just get the handler instead. )
    • getHandler

      @Nullable public static @Nullable ICellHandler getHandler(net.minecraft.world.item.ItemStack is)
      get the handler, for the requested item.
      Parameters:
      is - to be checked item
      Returns:
      the handler registered for this item type.
    • getGuiHandler

      @Nullable public static @Nullable ICellGuiHandler getGuiHandler(net.minecraft.world.item.ItemStack is)
      get the handler, for the requested channel.
      Parameters:
      is - ItemStack
      Returns:
      the handler registered for this channel.
    • getCellInventory

      @Nullable public static @Nullable StorageCell getCellInventory(net.minecraft.world.item.ItemStack is, @Nullable @Nullable ISaveProvider host)
      Returns the inventory for the provided storage cell item by querying all registered handlers.
      Parameters:
      is - item with inventory handler
      host - can be null. If provided, the host is responsible for persisting the cell content.
      Returns:
      The cell inventory, or null if there isn't one.