Class NBTSimpleInventoryItemHeld
java.lang.Object
org.cyclops.cyclopscore.inventory.SimpleInventory
org.cyclops.cyclopscore.inventory.NBTSimpleInventoryItemHeld
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.WorldlyContainer,org.cyclops.cyclopscore.inventory.INBTInventory,org.cyclops.cyclopscore.persist.nbt.INBTSerializable
A simple inventory for a currently held item by a player that can be stored in NBT.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cyclops.cyclopscore.persist.nbt.INBTSerializable
org.cyclops.cyclopscore.persist.nbt.INBTSerializable.SelfNBTClassType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.cyclops.cyclopscore.inventory.ItemLocationprotected final net.minecraft.world.entity.player.Playerprotected 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
ConstructorsConstructorDescriptionNBTSimpleInventoryItemHeld(net.minecraft.world.entity.player.Player player, org.cyclops.cyclopscore.inventory.ItemLocation itemLocation, int size, int stackLimit, String tagName) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidreadFromNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tagName) voidvoidwriteToNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tagName) Methods inherited from class org.cyclops.cyclopscore.inventory.SimpleInventory
addDirtyMarkListener, canPlaceItem, canPlaceItemThroughFace, canTakeItemThroughFace, clearContent, equals, fromNBT, getContainerSize, getItem, getItemHandler, getItemHandlerSided, getItemStacks, getMaxStackSize, getSlotsForFace, getState, hashCode, isEmpty, onInventoryChanged, read, removeDirtyMarkListener, removeItem, removeItemNoUpdate, setItem, startOpen, stillValid, stopOpen, toNBT, 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, getMaxStackSize, hasAnyMatching, hasAnyOf
-
Field Details
-
player
protected final net.minecraft.world.entity.player.Player player -
itemLocation
protected final org.cyclops.cyclopscore.inventory.ItemLocation itemLocation -
tagName
-
-
Constructor Details
-
NBTSimpleInventoryItemHeld
public NBTSimpleInventoryItemHeld(net.minecraft.world.entity.player.Player player, org.cyclops.cyclopscore.inventory.ItemLocation itemLocation, int size, int stackLimit, String tagName) Make a new instance.- Parameters:
player- The player holding the item.itemLocation- The item location.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 classSimpleInventory
-
readFromNBT
public void readFromNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tagName) - Overrides:
readFromNBTin classSimpleInventory
-
writeToNBT
public void writeToNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tagName) - Overrides:
writeToNBTin classSimpleInventory
-