Class PlatformInventoryWrapper

java.lang.Object
appeng.api.inventories.PlatformInventoryWrapper
All Implemented Interfaces:
InternalInventory, ItemTransfer, Iterable<net.minecraft.world.item.ItemStack>

public class PlatformInventoryWrapper extends Object implements InternalInventory
Wraps an inventory implementing the platforms standard inventory interface (i.e. IItemHandler on Forge) such that it can be used as an InternalInventory.
  • Constructor Details

    • PlatformInventoryWrapper

      public PlatformInventoryWrapper(net.neoforged.neoforge.items.IItemHandler handler)
  • Method Details

    • toItemHandler

      public net.neoforged.neoforge.items.IItemHandler toItemHandler()
      Specified by:
      toItemHandler in interface InternalInventory
    • size

      public int size()
      Specified by:
      size in interface InternalInventory
    • getSlotLimit

      public int getSlotLimit(int slot)
      Specified by:
      getSlotLimit in interface InternalInventory
    • getStackInSlot

      public net.minecraft.world.item.ItemStack getStackInSlot(int slotIndex)
      Specified by:
      getStackInSlot in interface InternalInventory
    • setItemDirect

      public void setItemDirect(int slotIndex, net.minecraft.world.item.ItemStack stack)
      Description copied from interface: InternalInventory
      Puts the given stack in the given slot and circumvents any potential filters.
      Specified by:
      setItemDirect in interface InternalInventory
    • isItemValid

      public boolean isItemValid(int slot, net.minecraft.world.item.ItemStack stack)
      Specified by:
      isItemValid in interface InternalInventory
    • insertItem

      public net.minecraft.world.item.ItemStack insertItem(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate)
      Specified by:
      insertItem in interface InternalInventory
      Returns:
      The overflow
    • extractItem

      public net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate)
      Specified by:
      extractItem in interface InternalInventory