Class ItemSlots

java.lang.Object
com.simibubi.create.foundation.item.ItemSlots

public class ItemSlots extends Object
Utility class representing non-empty slots in an item inventory.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ItemSlots> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ItemSlots> STREAM_CODEC
  • Constructor Details

    • ItemSlots

      public ItemSlots()
  • Method Details

    • set

      public void set(int slot, net.minecraft.world.item.ItemStack stack)
    • getSize

      public int getSize()
    • setSize

      public void setSize(int size)
    • forEach

      public void forEach(ItemSlots.SlotConsumer consumer)
    • toHandler

      public <T extends net.neoforged.neoforge.items.IItemHandlerModifiable> T toHandler(IntFunction<T> factory)
    • fromHandler

      public static ItemSlots fromHandler(net.neoforged.neoforge.items.IItemHandler handler)
    • toBoxedMap

      public Map<Integer,net.minecraft.world.item.ItemStack> toBoxedMap()
    • fromBoxedMap

      public static ItemSlots fromBoxedMap(Map<Integer,net.minecraft.world.item.ItemStack> map)
    • maxSizeCodec

      public static com.mojang.serialization.Codec<ItemSlots> maxSizeCodec(int maxSize)