public final class NBTEditor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
NBTEditor.NBTCompound
A class for holding NBTTagCompounds
|
| Constructor and Description |
|---|
NBTEditor() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
contains(java.lang.Object object,
java.lang.Object... keys)
Checks if the object contains the given key
|
static NBTEditor.NBTCompound |
getBlockNBTTag(org.bukkit.block.Block block,
java.lang.Object... keys)
Gets an NBTCompound from the block provided
|
static java.lang.Object |
getBlockTag(org.bukkit.block.Block block,
java.lang.Object... keys)
Deprecated.
Gets an NBT tag in a given block with the specified keys
|
static byte |
getByte(java.lang.Object object,
java.lang.Object... keys)
Gets a byte from an object
|
static byte[] |
getByteArray(java.lang.Object object,
java.lang.Object... keys)
Gets a byte array from an object
|
static double |
getDouble(java.lang.Object object,
java.lang.Object... keys)
Gets a double from an object
|
static NBTEditor.NBTCompound |
getEmptyNBTCompound()
Get an empty NBTCompound.
|
static NBTEditor.NBTCompound |
getEntityNBTTag(org.bukkit.entity.Entity entity,
java.lang.Object... keys)
Gets an NBTCompound from the entity provided
|
static java.lang.Object |
getEntityTag(org.bukkit.entity.Entity entity,
java.lang.Object... keys)
Deprecated.
Gets an NBT tag in a given entity with the specified keys
|
static float |
getFloat(java.lang.Object object,
java.lang.Object... keys)
Gets a float from an object
|
static org.bukkit.inventory.ItemStack |
getHead(java.lang.String skinURL)
Creates a skull with the given url as the skin
|
static int |
getInt(java.lang.Object object,
java.lang.Object... keys)
Gets an int from an object
|
static int[] |
getIntArray(java.lang.Object object,
java.lang.Object... keys)
Gets an int array from an object
|
static org.bukkit.inventory.ItemStack |
getItemFromTag(NBTEditor.NBTCompound compound)
Constructs an ItemStack from a given NBTCompound
|
static NBTEditor.NBTCompound |
getItemNBTTag(org.bukkit.inventory.ItemStack item,
java.lang.Object... keys)
Gets an NBTCompound from the item provided
|
static java.lang.Object |
getItemTag(org.bukkit.inventory.ItemStack item,
java.lang.Object... keys)
Deprecated.
Gets an NBT tag in a given item with the specified keys
|
static long |
getLong(java.lang.Object object,
java.lang.Object... keys)
Gets a long from an object
|
static NBTEditor.NBTCompound |
getNBTCompound(java.lang.String json)
Load an NBTCompound from a String.
|
static short |
getShort(java.lang.Object object,
java.lang.Object... keys)
Gets a short from an object
|
static java.lang.String |
getString(java.lang.Object object,
java.lang.Object... keys)
Gets a string from an object
|
static java.lang.String |
getTexture(org.bukkit.inventory.ItemStack head)
Fetches the texture of a skull
|
static java.lang.String |
getVersion()
Gets the Bukkit version
|
static <T> T |
set(T object,
java.lang.Object value,
java.lang.Object... keys)
Sets the value in the object with the given keys
|
static void |
setBlockTag(org.bukkit.block.Block block,
java.lang.Object value,
java.lang.Object... keys)
Deprecated.
Sets an NBT tag in an block with the provided keys and value
Should use the
set(Object, Object, Object...) method instead |
static void |
setEntityTag(org.bukkit.entity.Entity entity,
java.lang.Object value,
java.lang.Object... keys)
Deprecated.
Sets an NBT tag in an entity with the provided keys and value
Should use the
set(Object, Object, Object...) method instead |
static org.bukkit.inventory.ItemStack |
setItemTag(org.bukkit.inventory.ItemStack item,
java.lang.Object value,
java.lang.Object... keys)
Deprecated.
Sets an NBT tag in an item with the provided keys and value
Should use the
set(Object, Object, Object...) method instead |
static void |
setSkullTexture(org.bukkit.block.Block block,
java.lang.String texture)
Sets the texture of a skull block
|
public static java.lang.String getVersion()
public static org.bukkit.inventory.ItemStack getHead(java.lang.String skinURL)
skinURL - The URL of the skin, must be from mojangpublic static java.lang.String getTexture(org.bukkit.inventory.ItemStack head)
head - The item stack itselfpublic static java.lang.Object getItemTag(org.bukkit.inventory.ItemStack item,
java.lang.Object... keys)
item - The itemstack to get the keys fromkeys - The keys to fetch; an integer after a key value indicates that it should get the nth place of
the previous compound because it is a list;public static NBTEditor.NBTCompound getItemNBTTag(org.bukkit.inventory.ItemStack item, java.lang.Object... keys)
item - Itemstackkeys - Keys in descending orderpublic static org.bukkit.inventory.ItemStack setItemTag(org.bukkit.inventory.ItemStack item,
java.lang.Object value,
java.lang.Object... keys)
set(Object, Object, Object...) method insteaditem - The itemstack to setvalue - The value to setkeys - The keys to set, String for NBTCompound, int or null for an NBTTagListpublic static org.bukkit.inventory.ItemStack getItemFromTag(NBTEditor.NBTCompound compound)
compound - An NBTCompound following an ItemStack structurepublic static java.lang.Object getEntityTag(org.bukkit.entity.Entity entity,
java.lang.Object... keys)
entity - The entity to get the keys fromkeys - The keys to fetch; an integer after a key value indicates that it should get the nth place of
the previous compound because it is a list;public static NBTEditor.NBTCompound getEntityNBTTag(org.bukkit.entity.Entity entity, java.lang.Object... keys)
entity - The Bukkit entity providedkeys - Keys in descending orderpublic static void setEntityTag(org.bukkit.entity.Entity entity,
java.lang.Object value,
java.lang.Object... keys)
set(Object, Object, Object...) method insteadentity - The entity to setvalue - The value to setkeys - The keys to set, String for NBTCompound, int or null for an NBTTagListpublic static java.lang.Object getBlockTag(org.bukkit.block.Block block,
java.lang.Object... keys)
block - The block to get the keys fromkeys - The keys to fetch; an integer after a key value indicates that it should get the nth place of
the previous compound because it is a list;public static NBTEditor.NBTCompound getBlockNBTTag(org.bukkit.block.Block block, java.lang.Object... keys)
block - The block providedkeys - Keys in descending orderpublic static void setBlockTag(org.bukkit.block.Block block,
java.lang.Object value,
java.lang.Object... keys)
set(Object, Object, Object...) method insteadblock - The block to setvalue - The value to setkeys - The keys to set, String for NBTCompound, int or null for an NBTTagListpublic static void setSkullTexture(org.bukkit.block.Block block,
java.lang.String texture)
block - The block, must be a skulltexture - The URL of the skinpublic static java.lang.String getString(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static int getInt(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static double getDouble(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static long getLong(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static float getFloat(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static short getShort(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static byte getByte(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static byte[] getByteArray(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static int[] getIntArray(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static boolean contains(java.lang.Object object,
java.lang.Object... keys)
object - Must be an ItemStack, Entity, or Blockkeys - Keys in descending orderpublic static <T> T set(T object,
java.lang.Object value,
java.lang.Object... keys)
T - An ItemStack, Entity, Block, or NBTCompoundobject - Must be an ItemStack, Entity, or Blockvalue - The value to set, can be an NBTCompoundkeys - The keys in descending orderpublic static NBTEditor.NBTCompound getNBTCompound(java.lang.String json)
json - A String in json format.public static NBTEditor.NBTCompound getEmptyNBTCompound()