com.quartercode.quarterbukkit.api
Class TagUtil

java.lang.Object
  extended by com.quartercode.quarterbukkit.api.TagUtil

public class TagUtil
extends java.lang.Object

Class for modifying NBT-Tags and mutating Packtes easily. This is e.g. for modifying the name of items etc.


Method Summary
static java.util.List<java.lang.String> getDescriptions(org.bukkit.inventory.ItemStack itemStack)
          Returns the description lines of an ItemStack.
static java.lang.String getName(org.bukkit.inventory.ItemStack itemStack)
          Returns the name of an ItemStack.
static java.util.Map<org.bukkit.entity.Player,java.lang.String> getShowPlayerNames()
          Returns the saved player show names as unmodifiable map.
static void setDescriptions(org.bukkit.inventory.ItemStack itemStack, java.util.List<java.lang.String> descriptions)
          Sets the description lines of an ItemStack.
static void setName(org.bukkit.inventory.ItemStack itemStack, java.lang.String name)
          Sets the name of an ItemStack.
static void setShowName(org.bukkit.entity.Player player, java.lang.String name)
          Sets the name above the Player's head
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public static java.lang.String getName(org.bukkit.inventory.ItemStack itemStack)
Returns the name of an ItemStack.

Parameters:
itemStack - The ItemStack.
Returns:
The name of the ItemStack.

setName

public static void setName(org.bukkit.inventory.ItemStack itemStack,
                           java.lang.String name)
Sets the name of an ItemStack. You can use every chat code.

Parameters:
itemStack - The ItemStack to modify.
name - The name to set.

getDescriptions

public static java.util.List<java.lang.String> getDescriptions(org.bukkit.inventory.ItemStack itemStack)
Returns the description lines of an ItemStack. They equals to the "Lore".

Parameters:
itemStack - The ItemStack.
Returns:
The description lines of the ItemStack as an String-List.

setDescriptions

public static void setDescriptions(org.bukkit.inventory.ItemStack itemStack,
                                   java.util.List<java.lang.String> descriptions)
Sets the description lines of an ItemStack. They equals to the "Lore". You can use every chat code.

Parameters:
itemStack - The ItemStack to modify.
descriptions - The description lines to set as an String-List.

getShowPlayerNames

public static java.util.Map<org.bukkit.entity.Player,java.lang.String> getShowPlayerNames()
Returns the saved player show names as unmodifiable map. You can add players with setShowName().

Returns:
The saved player show names.

setShowName

public static void setShowName(org.bukkit.entity.Player player,
                               java.lang.String name)
Sets the name above the Player's head

Parameters:
player - The Player to modify.
name - The show name above the Player's head to set.