Package dk.lockfuglsang.minecraft.nbt
Enum Class NBTUtil
- All Implemented Interfaces:
Serializable
,Comparable<NBTUtil>
,Constable
Utility for setting NBTTag data on Bukkit items without NMS (using reflection).
- Since:
- 1.7
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.ItemStack
Returns a copy of theitemStack
with the suppliednbtTagString
applied.static String
getNBTTag(org.bukkit.inventory.ItemStack itemStack)
Returns the NBTTag of theitemStack
as a string, or the empty-string if none was found.static void
setNBTItemStackTagger(NBTItemStackTagger tagger)
static org.bukkit.inventory.ItemStack
Returns a copy of theitemStack
with the suppliednbtTagString
applied.static NBTUtil
Returns the enum constant of this class with the specified name.static NBTUtil[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getNBTTag
Returns the NBTTag of theitemStack
as a string, or the empty-string if none was found.- Parameters:
itemStack
- A Bukkit ItemStack- Returns:
- the NBTTag
- Since:
- 1.7
-
setNBTTag
public static org.bukkit.inventory.ItemStack setNBTTag(org.bukkit.inventory.ItemStack itemStack, String nbtTagString)Returns a copy of theitemStack
with the suppliednbtTagString
applied.- Parameters:
itemStack
- A Bukkit ItemStacknbtTagString
- A valid NBTTag string- Returns:
- a copy of the
itemStack
- Since:
- 1.7
-
addNBTTag
public static org.bukkit.inventory.ItemStack addNBTTag(org.bukkit.inventory.ItemStack itemStack, String nbtTagString)Returns a copy of theitemStack
with the suppliednbtTagString
applied.- Parameters:
itemStack
- A Bukkit ItemStacknbtTagString
- A valid NBTTag string- Returns:
- a copy of the
itemStack
- Since:
- 1.7
-
setNBTItemStackTagger
-