Class endstone::ItemStack¶
ClassList > endstone > ItemStack
Represents a stack of items.
#include <endstone/inventory/item_stack.h>
Public Functions¶
| Type | Name |
|---|---|
| ItemStack () = default |
|
| ItemStack (std::string type, int amount=1) |
|
| virtual int | getAmount () const Gets the amount of items in this stack. |
| virtual std::unique_ptr< ItemMeta > | getItemMeta () const Gets a copy of this ItemStack 'sItemMeta . |
| virtual std::string | getType () const Gets the type of this item. |
| virtual bool | hasItemMeta () const Checks to see if any metadata has been defined. |
| virtual void | setAmount (int amount) Sets the amount of items in this stack. |
| virtual bool | setItemMeta (ItemMeta * meta) Set the ItemMeta of thisItemStack . |
| virtual void | setType (std::string type) Sets the type of this item. |
| virtual | ~ItemStack () = default |
Protected Functions¶
| Type | Name |
|---|---|
| virtual bool | isEndstoneItemStack () const |
Public Functions Documentation¶
function ItemStack [½]¶
function ItemStack [2/2]¶
function getAmount¶
Gets the amount of items in this stack.
Returns:
Amount of items in this stack
function getItemMeta¶
Gets a copy of this ItemStack 'sItemMeta .
Returns:
a copy of the current ItemStack's ItemMeta
function getType¶
Gets the type of this item.
Returns:
Type of the items in this stack
function hasItemMeta¶
Checks to see if any metadata has been defined.
Returns:
Returns true if some metadata has been set for this item
function setAmount¶
Sets the amount of items in this stack.
Parameters:
amountNew amount of items in this stack
function setItemMeta¶
Set the ItemMeta of thisItemStack .
Parameters:
metanew ItemMeta, or null to indicate meta data be cleared.
Returns:
True if successfully applied ItemMeta
function setType¶
Sets the type of this item.
Parameters:
typeNew type to set the items in this stack to
function ~ItemStack¶
Protected Functions Documentation¶
function isEndstoneItemStack¶
Friends Documentation¶
friend EndstoneItemStack¶
The documentation for this class was generated from the following file include/endstone/inventory/item_stack.h