Class ItemContainers
java.lang.Object
net.ixdarklord.coolcatcore.api.container.ItemContainers
Inventories kept in an item stack's
minecraft:container component (as shulker boxes keep theirs).
SlotContainer pouch = ItemContainers.of(stack, POUCH_LAYOUT);
pouch.insert(new ItemStack(Items.DIAMOND), false); // written back to the stack right away
player.openMenu(new SimpleMenuProvider((id, inventory, p) -> new PouchMenu(id, inventory, pouch), title));
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable SlotContainerof(net.minecraft.world.item.ItemStack stack) The inventory of aContainerItem's stack, ornullfor other items.static SlotContainerof(net.minecraft.world.item.ItemStack stack, ContainerLayout layout) The stack's inventory: reads the stack now and writes every change back to it.
-
Method Details
-
of
The stack's inventory: reads the stack now and writes every change back to it. Keep it only as long as the stack is the one in use (a menu should check the player still holds it). -
of
The inventory of aContainerItem's stack, ornullfor other items.
-