Package valorless.valorlessutils.nbt
Class NBT
java.lang.Object
valorless.valorlessutils.nbt.NBT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanRetrieves a boolean value from the NBT data of an ItemStack.static DoubleRetrieves a double value from the NBT data of an ItemStack.static FloatRetrieves a float value from the NBT data of an ItemStack.static IntegerRetrieves an integer value from the NBT data of an ItemStack.GetIntArray(org.bukkit.inventory.ItemStack item, String key) Retrieves an integer array from the NBT data of an ItemStack.static StringRetrieves a string value from the NBT data of an ItemStack.GetStringList(org.bukkit.inventory.ItemStack item, String key) Retrieves a Listvalue from the NBT data of an ItemStack. static UUIDRetrieves a UUID value from the NBT data of an ItemStack.static booleanChecks if the NBT data of an ItemStack contains a given key.static booleanRemoves a key from the NBT data of an ItemStack.static voidSets a boolean value in the NBT data of an ItemStack.static voidSets a double value in the NBT data of an ItemStack.static voidSets a float value in the NBT data of an ItemStack.static voidSets an integer value in the NBT data of an ItemStack.static voidSetIntArray(org.bukkit.inventory.ItemStack item, String key, int[] value) Sets an integer array in the NBT data of an ItemStack.static voidSets a string value in the NBT data of an ItemStack.static voidSetStringList(org.bukkit.inventory.ItemStack item, String key, List<String> value) Sets a List of strings in the NBT data of an ItemStack.static voidSets a UUID value in the NBT data of an ItemStack.
- 
Constructor Details- 
NBTpublic NBT()
 
- 
- 
Method Details- 
SetStringSets a string value in the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The string value to set.
 
- 
SetStringListpublic static void SetStringList(org.bukkit.inventory.ItemStack item, String key, List<String> value) Sets a List of strings in the NBT data of an ItemStack. The list is stored as a single string joined by "◊".- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The List- value to set. 
 
- 
SetIntSets an integer value in the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The integer value to set.
 
- 
SetIntArraySets an integer array in the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The integer array to set.
 
- 
SetFloatSets a float value in the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The float value to set.
 
- 
SetDoubleSets a double value in the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The double value to set.
 
- 
SetBoolSets a boolean value in the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The boolean value to set.
 
- 
SetUUIDSets a UUID value in the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to set.
- value- The UUID value to set.
 
- 
GetStringRetrieves a string value from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The string value or null if not present.
 
- 
GetStringListRetrieves a Listvalue from the NBT data of an ItemStack. Splits the stored string by "◊". - Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The Listvalue. 
 
- 
GetIntRetrieves an integer value from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The integer value.
 
- 
GetIntArrayRetrieves an integer array from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The list of integers.
 
- 
GetFloatRetrieves a float value from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The float value.
 
- 
GetDoubleRetrieves a double value from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The double value.
 
- 
GetBoolRetrieves a boolean value from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The boolean value.
 
- 
GetUUIDRetrieves a UUID value from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to retrieve from.
- key- The key to retrieve.
- Returns:
- The UUID value.
 
- 
HasChecks if the NBT data of an ItemStack contains a given key.- Parameters:
- item- The ItemStack to check.
- key- The key to check.
- Returns:
- True if the key exists, false otherwise.
 
- 
RemoveRemoves a key from the NBT data of an ItemStack.- Parameters:
- item- The ItemStack to modify.
- key- The key to remove.
- Returns:
- False (always returns false currently; actual removal happens inside the modify call).
 
 
-