Interface ItemMeta
- All Known Implementing Classes:
CompassMeta
,CrossbowMeta
,EnchantedBookMeta
,FireworkMeta
,LeatherArmorMeta
,MapMeta
,PlayerHeadMeta
,PotionMeta
,SpawnEggMeta
,WritableBookMeta
,WrittenBookMeta
public interface ItemMeta
Represents nbt data only available for a type of item.
-
Method Summary
Modifier and Type Method Description ItemMeta
copy()
Copies this item meta.boolean
hasNbt()
Gets if this meta object contains any useful data to send to the client.boolean
isSimilar(ItemMeta itemMeta)
Gets if the two ItemMeta are similar.void
read(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Reads nbt data from a compound.void
write(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Writes nbt data to a compound.
-
Method Details
-
hasNbt
boolean hasNbt()Gets if this meta object contains any useful data to send to the client.- Returns:
- true if this item has nbt data, false otherwise
-
isSimilar
Gets if the two ItemMeta are similar.It is used by
ItemStack.isSimilar(ItemStack)
.- Parameters:
itemMeta
- the second item meta to check- Returns:
- true if the two meta are similar, false otherwise
-
read
void read(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Reads nbt data from a compound.WARNING: it is possible that it contains no useful data, it has to be checked before getting anything.
- Parameters:
compound
- the compound containing the data
-
write
void write(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Writes nbt data to a compound.- Parameters:
compound
- the compound receiving the item meta data
-
copy
Copies this item meta.Used by
ItemStack.copy()
.- Returns:
- the cloned item meta
-