Class SmartInventory

java.lang.Object
net.minecraftforge.items.wrapper.RecipeWrapper
com.simibubi.create.foundation.item.SmartInventory
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.items.IItemHandler, net.minecraftforge.items.IItemHandlerModifiable
Direct Known Subclasses:
BasinInventory, MechanicalCrafterTileEntity.Inventory

public class SmartInventory extends net.minecraftforge.items.wrapper.RecipeWrapper implements net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
  • Field Details

    • extractionAllowed

      protected boolean extractionAllowed
    • insertionAllowed

      protected boolean insertionAllowed
    • stackNonStackables

      protected boolean stackNonStackables
    • wrapped

      protected com.simibubi.create.foundation.item.SmartInventory.SyncedStackHandler wrapped
    • stackSize

      protected int stackSize
  • Constructor Details

    • SmartInventory

      public SmartInventory(int slots, SyncedTileEntity te)
    • SmartInventory

      public SmartInventory(int slots, SyncedTileEntity te, int stackSize, boolean stackNonStackables)
  • Method Details

    • withMaxStackSize

      public SmartInventory withMaxStackSize(int maxStackSize)
    • whenContentsChanged

      public SmartInventory whenContentsChanged(Consumer<Integer> updateCallback)
    • allowInsertion

      public SmartInventory allowInsertion()
    • allowExtraction

      public SmartInventory allowExtraction()
    • forbidInsertion

      public SmartInventory forbidInsertion()
    • forbidExtraction

      public SmartInventory forbidExtraction()
    • getSlots

      public int getSlots()
      Specified by:
      getSlots in interface net.minecraftforge.items.IItemHandler
    • insertItem

      public net.minecraft.world.item.ItemStack insertItem(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate)
      Specified by:
      insertItem in interface net.minecraftforge.items.IItemHandler
    • extractItem

      public net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate)
      Specified by:
      extractItem in interface net.minecraftforge.items.IItemHandler
    • getSlotLimit

      public int getSlotLimit(int slot)
      Specified by:
      getSlotLimit in interface net.minecraftforge.items.IItemHandler
    • isItemValid

      public boolean isItemValid(int slot, net.minecraft.world.item.ItemStack stack)
      Specified by:
      isItemValid in interface net.minecraftforge.items.IItemHandler
    • setStackInSlot

      public void setStackInSlot(int slot, net.minecraft.world.item.ItemStack stack)
      Specified by:
      setStackInSlot in interface net.minecraftforge.items.IItemHandlerModifiable
    • getItem

      public net.minecraft.world.item.ItemStack getItem(int slot)
      Specified by:
      getItem in interface net.minecraft.world.Container
      Overrides:
      getItem in class net.minecraftforge.items.wrapper.RecipeWrapper
    • getStackLimit

      public int getStackLimit(int slot, @Nonnull net.minecraft.world.item.ItemStack stack)
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT()
      Specified by:
      serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag nbt)
      Specified by:
      deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • getStackInSlotIntermediate

      public net.minecraft.world.item.ItemStack getStackInSlotIntermediate(int slot)
    • getStackInSlot

      default net.minecraft.world.item.ItemStack getStackInSlot(int slot)
      Specified by:
      getStackInSlot in interface net.minecraftforge.items.IItemHandler