public class InventoryState extends Object
Inventory
Constructor and Description |
---|
InventoryState(org.bukkit.inventory.Inventory i)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.bukkit.inventory.ItemStack[] |
getContents()
Deprecated.
Returns an array copy, should not be used heavily
|
org.bukkit.inventory.ItemStack |
getItem(int index)
Returns the
ItemStack in the given inventory slot |
void |
setContents(org.bukkit.inventory.InventoryHolder holder)
Sets the contents of this state into an
InventoryHolder |
int |
size()
Returns the length of the underlying
ItemStack array |
public InventoryState(org.bukkit.inventory.Inventory i)
i
- The Inventory
to copypublic org.bukkit.inventory.ItemStack[] getContents()
public org.bukkit.inventory.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(org.bukkit.inventory.InventoryHolder holder)
InventoryHolder
holder
- The InventoryHolder
to set the contents ofCopyright © 2015. All rights reserved.