Class endstone::ItemMeta¶
ClassList > endstone > ItemMeta
Represents the metadata of a generic item.
#include <endstone/inventory/meta/item_meta.h>
Inherited by the following classes: endstone::MapMeta
Public Types¶
Type | Name |
---|---|
enum | Type |
Public Static Attributes¶
Type | Name |
---|---|
ItemMeta | EMPTY |
Public Functions¶
Type | Name |
---|---|
ItemMeta () = default |
|
ItemMeta (const ItemMeta * meta) |
|
virtual std::unique_ptr< ItemMeta > | clone () const Creates a clone of the current metadata. |
virtual int | getDamage () const Gets the damage. |
virtual std::optional< std::string > | getDisplayName () const Gets the display name that is set. |
virtual std::optional< std::vector< std::string > > | getLore () const Gets the lore that is set. |
virtual Type | getType () const Gets the type of this item meta. |
virtual bool | hasDamage () const Checks to see if this item has damage. |
virtual bool | hasDisplayName () const Checks for existence of a display name. |
virtual bool | hasLore () const Checks for existence of lore. |
virtual bool | isEmpty () const Checks if the item metadata is empty. |
virtual void | setDamage (int damage) Sets the damage. |
virtual void | setDisplayName (std::optional< std::string > name) Sets the display name. |
virtual void | setLore (std::optional< std::vector< std::string > > lore) Sets the lore for this item or removes lore when given std::nullopt. |
virtual | ~ItemMeta () = default |
Public Types Documentation¶
enum Type¶
Public Static Attributes Documentation¶
variable EMPTY¶
Public Functions Documentation¶
function ItemMeta [½]¶
function ItemMeta [2/2]¶
function clone¶
Creates a clone of the current metadata.
Returns:
A copy of the metadata containing the same state as the original.
function getDamage¶
Gets the damage.
Returns:
the damage
function getDisplayName¶
Gets the display name that is set.
Returns:
the display name that is set
function getLore¶
Gets the lore that is set.
Returns:
a list of lore that is set
function getType¶
Gets the type of this item meta.
Returns:
type of this item meta
function hasDamage¶
Checks to see if this item has damage.
Returns:
true if this has damage
function hasDisplayName¶
Checks for existence of a display name.
Returns:
true if this has a display name
function hasLore¶
Checks for existence of lore.
Returns:
true if this has lore
function isEmpty¶
Checks if the item metadata is empty.
Returns:
true if the metadata is empty, false otherwise.
function setDamage¶
Sets the damage.
Parameters:
damage
item damage
function setDisplayName¶
Sets the display name.
Parameters:
name
the name to set
function setLore¶
Sets the lore for this item or removes lore when given std::nullopt.
inline virtual void endstone::ItemMeta::setLore (
std::optional< std::vector< std::string > > lore
)
Parameters:
lore
the lore that will be set
function ~ItemMeta¶
The documentation for this class was generated from the following file include/endstone/inventory/meta/item_meta.h