Class NBTSimpleInventoryItemStack
java.lang.Object
org.cyclops.cyclopscore.inventory.SimpleInventory
org.cyclops.cyclopscore.inventory.NBTSimpleInventoryItemStack
- All Implemented Interfaces:
Iterable<net.minecraft.world.item.ItemStack>,net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.entity.SlotProvider,net.minecraft.world.WorldlyContainer,net.neoforged.neoforge.common.extensions.ContainerExtension,org.cyclops.cyclopscore.inventory.INBTInventory,org.cyclops.cyclopscore.persist.nbt.INBTSerializable
public class NBTSimpleInventoryItemStack
extends org.cyclops.cyclopscore.inventory.SimpleInventory
A simple inventory for an ItemStack that can be stored in NBT.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.Container
net.minecraft.world.Container.ContainerIteratorNested classes/interfaces inherited from interface org.cyclops.cyclopscore.persist.nbt.INBTSerializable
org.cyclops.cyclopscore.persist.nbt.INBTSerializable.SelfNBTClassType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final net.neoforged.neoforge.transfer.access.ItemAccessprotected final StringFields inherited from class org.cyclops.cyclopscore.inventory.SimpleInventory
CODEC, contents, STREAM_CODECFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionNBTSimpleInventoryItemStack(net.neoforged.neoforge.transfer.access.ItemAccess itemAccess, int size, int stackLimit, String tagName) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidreadFromNBT(net.minecraft.world.level.storage.ValueInput data, String tagName) voidvoidwriteToNBT(net.minecraft.world.level.storage.ValueOutput data, String tagName) Methods inherited from class org.cyclops.cyclopscore.inventory.SimpleInventory
addDirtyMarkListener, canPlaceItem, canPlaceItemThroughFace, canTakeItemThroughFace, clearContent, equals, fromValueInput, getContainerSize, getItem, getItemStacks, getMaxStackSize, getSlotsForFace, getState, hashCode, isEmpty, onInventoryChanged, read, removeDirtyMarkListener, removeItem, removeItemNoUpdate, setItem, startOpen, stillValid, stopOpen, toValueOutput, writeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iteratorMethods inherited from interface net.neoforged.neoforge.common.extensions.ContainerExtension
onTransfer, setItemMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.world.entity.SlotProvider
getSlotsFromRange
-
Field Details
-
itemAccess
protected final net.neoforged.neoforge.transfer.access.ItemAccess itemAccess -
tagName
-
-
Constructor Details
-
NBTSimpleInventoryItemStack
public NBTSimpleInventoryItemStack(net.neoforged.neoforge.transfer.access.ItemAccess itemAccess, int size, int stackLimit, String tagName) Make a new instance.- Parameters:
itemAccess- The item access.size- The amount of slots in the inventory.stackLimit- The stack limit for each slot.tagName- The NBT tag name to store this inventory in. This should be the same tag name that is used to call the NBT read/write methods.
-
-
Method Details
-
setChanged
public void setChanged()- Specified by:
setChangedin interfacenet.minecraft.world.Container- Overrides:
setChangedin classorg.cyclops.cyclopscore.inventory.SimpleInventory
-
readFromNBT
- Overrides:
readFromNBTin classorg.cyclops.cyclopscore.inventory.SimpleInventory
-
writeToNBT
- Overrides:
writeToNBTin classorg.cyclops.cyclopscore.inventory.SimpleInventory
-