Class LazuliItemStackHandler

java.lang.Object
net.neoforged.neoforge.items.ItemStackHandler
top.girlkisser.lazuli.api.inventory.LazuliItemStackHandler
All Implemented Interfaces:
net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>, net.neoforged.neoforge.items.IItemHandler, net.neoforged.neoforge.items.IItemHandlerModifiable, ISerializableItemHandler

public class LazuliItemStackHandler extends net.neoforged.neoforge.items.ItemStackHandler implements ISerializableItemHandler
An ItemStackHandler with some helper methods.
  • Field Summary

    Fields inherited from class net.neoforged.neoforge.items.ItemStackHandler

    stacks
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a LazuliItemStackHandler with a size of 1.
    Creates a LazuliItemStackHandler with the given size.
    LazuliItemStackHandler(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> stacks)
    Creates a LazuliItemStackHandler with the given stacks.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.ItemStack
    insertItem(net.minecraft.world.item.ItemStack stack, boolean simulate)
    Attempt to insert an item into the stack handler.
    static net.minecraft.world.item.ItemStack
    insertItem(net.neoforged.neoforge.items.ItemStackHandler handler, net.minecraft.world.item.ItemStack stack, boolean simulate)
    Attempt to insert an item into the stack handler.

    Methods inherited from class net.neoforged.neoforge.items.ItemStackHandler

    deserializeNBT, extractItem, getSlotLimit, getSlots, getStackInSlot, getStackLimit, insertItem, isItemValid, onContentsChanged, onLoad, serializeNBT, setSize, setStackInSlot, validateSlotIndex

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.neoforge.items.IItemHandler

    extractItem, getSlotLimit, getSlots, getStackInSlot, insertItem, isItemValid

    Methods inherited from interface net.neoforged.neoforge.common.util.INBTSerializable

    deserializeNBT, serializeNBT
  • Constructor Details

    • LazuliItemStackHandler

      public LazuliItemStackHandler()
      Creates a LazuliItemStackHandler with a size of 1.
    • LazuliItemStackHandler

      public LazuliItemStackHandler(int size)
      Creates a LazuliItemStackHandler with the given size.
      Parameters:
      size - The size.
    • LazuliItemStackHandler

      public LazuliItemStackHandler(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> stacks)
      Creates a LazuliItemStackHandler with the given stacks.
      Parameters:
      stacks - The stacks.
  • Method Details

    • insertItem

      public net.minecraft.world.item.ItemStack insertItem(net.minecraft.world.item.ItemStack stack, boolean simulate)
      Attempt to insert an item into the stack handler.
      Parameters:
      stack - The item stack to insert.
      simulate - If this action should be simulated.
      Returns:
      The remainder, if there was one.
    • insertItem

      public static net.minecraft.world.item.ItemStack insertItem(net.neoforged.neoforge.items.ItemStackHandler handler, net.minecraft.world.item.ItemStack stack, boolean simulate)
      Attempt to insert an item into the stack handler.
      Parameters:
      handler - The inventory to insert into.
      stack - The item stack to insert.
      simulate - If this action should be simulated.
      Returns:
      The remainder, if there was one.