Class LodestoneBlockEntityInventory

java.lang.Object
net.minecraftforge.items.ItemStackHandler
team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntityInventory
All Implemented Interfaces:
net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.items.IItemHandler, net.minecraftforge.items.IItemHandlerModifiable

public class LodestoneBlockEntityInventory extends net.minecraftforge.items.ItemStackHandler
A powerful ItemStackHandler designed to work with block entities
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
     
    int
     
    int
     
    Predicate<net.minecraft.world.item.ItemStack>
     
    final net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>
     
    int
     
    ArrayList<net.minecraft.world.item.ItemStack>
     
    Predicate<net.minecraft.world.item.ItemStack>
     
    final int
     

    Fields inherited from class net.minecraftforge.items.ItemStackHandler

    stacks
  • Constructor Summary

    Constructors
    Constructor
    Description
    LodestoneBlockEntityInventory(int slotCount, int allowedItemSize)
     
    LodestoneBlockEntityInventory(int slotCount, int allowedItemSize, Predicate<net.minecraft.world.item.ItemStack> inputPredicate)
     
    LodestoneBlockEntityInventory(int slotCount, int allowedItemSize, Predicate<net.minecraft.world.item.ItemStack> inputPredicate, Predicate<net.minecraft.world.item.ItemStack> outputPredicate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    dumpItems(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
     
    void
    dumpItems(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 pos)
     
    net.minecraft.world.item.ItemStack
    extractItem(int slot, int amount, boolean simulate)
     
    void
    extractItem(net.minecraft.world.entity.player.Player playerEntity, net.minecraft.world.item.ItemStack stack, int slot)
     
    net.minecraft.world.item.ItemStack
    extractItem(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack heldStack, net.minecraft.world.entity.player.Player player)
     
    int
    getSlotLimit(int slot)
     
    int
     
    net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    net.minecraft.world.item.ItemStack
    insertItem(net.minecraft.world.entity.player.Player playerEntity, net.minecraft.world.item.ItemStack stack)
     
    net.minecraft.world.item.ItemStack
    insertItem(net.minecraft.world.item.ItemStack stack)
     
    net.minecraft.world.item.ItemStack
    insertItem(net.minecraft.world.item.ItemStack stack, boolean simulate)
     
    net.minecraft.world.item.ItemStack
    interact(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand handIn)
     
    boolean
     
    boolean
    isItemValid(int slot, net.minecraft.world.item.ItemStack stack)
     
    void
    load(net.minecraft.nbt.CompoundTag compound)
     
    void
    load(net.minecraft.nbt.CompoundTag compound, String name)
     
    void
     
    void
    save(net.minecraft.nbt.CompoundTag compound)
     
    void
    save(net.minecraft.nbt.CompoundTag compound, String name)
     
    void
     

    Methods inherited from class net.minecraftforge.items.ItemStackHandler

    deserializeNBT, getStackInSlot, getStackLimit, insertItem, onLoad, serializeNBT, setSize, setStackInSlot, validateSlotIndex

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • slotCount

      public final int slotCount
    • allowedItemSize

      public final int allowedItemSize
    • inputPredicate

      public Predicate<net.minecraft.world.item.ItemStack> inputPredicate
    • outputPredicate

      public Predicate<net.minecraft.world.item.ItemStack> outputPredicate
    • inventoryOptional

      public final net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler> inventoryOptional
    • nonEmptyItemStacks

      public ArrayList<net.minecraft.world.item.ItemStack> nonEmptyItemStacks
    • emptyItemAmount

      public int emptyItemAmount
    • nonEmptyItemAmount

      public int nonEmptyItemAmount
    • firstEmptyItemIndex

      public int firstEmptyItemIndex
  • Constructor Details

    • LodestoneBlockEntityInventory

      public LodestoneBlockEntityInventory(int slotCount, int allowedItemSize, Predicate<net.minecraft.world.item.ItemStack> inputPredicate, Predicate<net.minecraft.world.item.ItemStack> outputPredicate)
    • LodestoneBlockEntityInventory

      public LodestoneBlockEntityInventory(int slotCount, int allowedItemSize, Predicate<net.minecraft.world.item.ItemStack> inputPredicate)
    • LodestoneBlockEntityInventory

      public LodestoneBlockEntityInventory(int slotCount, int allowedItemSize)
  • Method Details

    • onContentsChanged

      public void onContentsChanged(int slot)
      Overrides:
      onContentsChanged in class net.minecraftforge.items.ItemStackHandler
    • getSlots

      public int getSlots()
      Specified by:
      getSlots in interface net.minecraftforge.items.IItemHandler
      Overrides:
      getSlots in class net.minecraftforge.items.ItemStackHandler
    • getSlotLimit

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

      public boolean isItemValid(int slot, @Nonnull net.minecraft.world.item.ItemStack stack)
      Specified by:
      isItemValid in interface net.minecraftforge.items.IItemHandler
      Overrides:
      isItemValid in class net.minecraftforge.items.ItemStackHandler
    • extractItem

      @Nonnull public net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate)
      Specified by:
      extractItem in interface net.minecraftforge.items.IItemHandler
      Overrides:
      extractItem in class net.minecraftforge.items.ItemStackHandler
    • updateData

      public void updateData()
    • load

      public void load(net.minecraft.nbt.CompoundTag compound)
    • load

      public void load(net.minecraft.nbt.CompoundTag compound, String name)
    • save

      public void save(net.minecraft.nbt.CompoundTag compound)
    • save

      public void save(net.minecraft.nbt.CompoundTag compound, String name)
    • getStacks

      public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getStacks()
    • isEmpty

      public boolean isEmpty()
    • clear

      public void clear()
    • dumpItems

      public void dumpItems(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    • dumpItems

      public void dumpItems(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 pos)
    • interact

      public net.minecraft.world.item.ItemStack interact(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand handIn)
    • extractItem

      public net.minecraft.world.item.ItemStack extractItem(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack heldStack, net.minecraft.world.entity.player.Player player)
    • extractItem

      public void extractItem(net.minecraft.world.entity.player.Player playerEntity, net.minecraft.world.item.ItemStack stack, int slot)
    • insertItem

      public net.minecraft.world.item.ItemStack insertItem(net.minecraft.world.entity.player.Player playerEntity, net.minecraft.world.item.ItemStack stack)
    • insertItem

      public net.minecraft.world.item.ItemStack insertItem(net.minecraft.world.item.ItemStack stack)
    • insertItem

      public net.minecraft.world.item.ItemStack insertItem(net.minecraft.world.item.ItemStack stack, boolean simulate)