Class IndexedInventory
java.lang.Object
org.cyclops.cyclopscore.inventory.SimpleInventory
org.cyclops.cyclopscore.inventory.LargeInventory
org.cyclops.cyclopscore.inventory.IndexedInventory
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.WorldlyContainer,INBTInventory,IndexedSlotlessItemHandlerWrapper.IInventoryIndexReference,INBTSerializable
public class IndexedInventory
extends LargeInventory
implements IndexedSlotlessItemHandlerWrapper.IInventoryIndexReference
An inventory that adds an index from item to slot on a regular inventory.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cyclops.cyclopscore.persist.nbt.INBTSerializable
INBTSerializable.SelfNBTClassType -
Field Summary
Fields inherited from class org.cyclops.cyclopscore.inventory.SimpleInventory
contentsFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for NBT persistence, don't call this yourself.IndexedInventory(int size, int stackLimit) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidMap<net.minecraft.world.item.Item,it.unimi.dsi.fastutil.ints.Int2ObjectMap<net.minecraft.world.item.ItemStack>> getIndex()intvoidreadFromNBT(net.minecraft.nbt.CompoundTag data, String tag) Read inventory data from the given NBT.voidsetItem(int slotId, net.minecraft.world.item.ItemStack itemStack) Methods inherited from class org.cyclops.cyclopscore.inventory.LargeInventory
writeToNBTMethods inherited from class org.cyclops.cyclopscore.inventory.SimpleInventory
addDirtyMarkListener, canPlaceItem, canPlaceItemThroughFace, canTakeItemThroughFace, fromNBT, getContainerSize, getItem, getItemHandler, getItemHandlerSided, getItemStacks, getMaxStackSize, getSlotsForFace, getState, isEmpty, onInventoryChanged, read, removeDirtyMarkListener, removeItem, removeItemNoUpdate, setChanged, startOpen, stillValid, stopOpen, toNBT, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, hasAnyMatching, hasAnyOf
-
Constructor Details
-
IndexedInventory
public IndexedInventory()Default constructor for NBT persistence, don't call this yourself. -
IndexedInventory
public IndexedInventory(int size, int stackLimit) Make a new instance.- Parameters:
size- The amount of slots in the inventory.stackLimit- The stack limit for each slot.
-
-
Method Details
-
createIndex
protected void createIndex() -
readFromNBT
Description copied from class:LargeInventoryRead inventory data from the given NBT.- Overrides:
readFromNBTin classLargeInventory- Parameters:
data- The NBT data containing inventory data.tag- The NBT tag name where the info is located.
-
setItem
public void setItem(int slotId, net.minecraft.world.item.ItemStack itemStack) - Specified by:
setItemin interfacenet.minecraft.world.Container- Overrides:
setItemin classSimpleInventory
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable- Overrides:
clearContentin classSimpleInventory
-
getInventoryReferenceStackLimit
public int getInventoryReferenceStackLimit()- Specified by:
getInventoryReferenceStackLimitin interfaceIndexedSlotlessItemHandlerWrapper.IInventoryIndexReference
-
getIndex
public Map<net.minecraft.world.item.Item,it.unimi.dsi.fastutil.ints.Int2ObjectMap<net.minecraft.world.item.ItemStack>> getIndex()- Specified by:
getIndexin interfaceIndexedSlotlessItemHandlerWrapper.IInventoryIndexReference
-
getEmptySlots
- Specified by:
getEmptySlotsin interfaceIndexedSlotlessItemHandlerWrapper.IInventoryIndexReference
-
getNonEmptySlots
- Specified by:
getNonEmptySlotsin interfaceIndexedSlotlessItemHandlerWrapper.IInventoryIndexReference
-