public class InventoryState extends Object
Inventory
Constructor and Description |
---|
InventoryState(Inventory i)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ItemStack[] |
getContents()
Deprecated.
Returns an array copy, should not be used heavily
|
ItemStack |
getItem(int index)
Returns the
ItemStack in the given inventory slot |
void |
setContents(InventoryHolder holder)
Sets the contents of this state into an
InventoryHolder |
int |
size()
Returns the length of the underlying
ItemStack array |
public ItemStack[] getContents()
public ItemStack getItem(int index)
ItemStack
in the given inventory slotindex
- The index or "slot" to retrieve fromItemStack
in the relevant indexArrayIndexOutOfBoundsException
- 0 <= index < size()
public int size()
ItemStack
arraypublic void setContents(InventoryHolder holder)
InventoryHolder
holder
- The InventoryHolder
to set the contents ofCopyright © 2017. All rights reserved.