public abstract class TagFactory
extends java.lang.Object
NBTBaseTag
for this basic
interaction.Constructor and Description |
---|
TagFactory() |
Modifier and Type | Method and Description |
---|---|
static TagFactory |
get()
Get the instance of a
TagFactory that supports the current
server version. |
abstract NBTIODelegate<org.bukkit.block.BlockState> |
getBlockIODelegate()
NOTE: This delegate must assume that any
BlockState s given
to it are tile entities! There is no exposed interface in Spigot for
the sub set of BlockStates that are tile entities so it is left to the caller
to ensure this safety. |
abstract NBTIODelegate<org.bukkit.entity.Entity> |
getEntityIODelegate() |
abstract NBTIODelegate<java.io.File> |
getFileIODelegate()
Warning: Reading an empty tag will throw an exception.
|
abstract NBTIODelegate<org.bukkit.inventory.ItemStack> |
getItemIODelegate() |
abstract NBTBaseTag<byte[]> |
newByteArrayTag(byte[] value)
Wrap the value in a byte[] tag.
|
abstract NBTBaseTag<java.lang.Byte> |
newByteTag(byte value)
Wrap the value in a byte tag.
|
abstract NBTCompoundTag |
newCompoundTag()
Create an empty compound tag.
|
abstract NBTBaseTag<java.lang.Double> |
newDoubleTag(double value)
Wrap the value in a double tag.
|
abstract NBTBaseTag<java.lang.Float> |
newFloatTag(float value)
Wrap the value in a float tag.
|
abstract NBTBaseTag<int[]> |
newIntArrayTag(int[] value)
Wrap the value in a int[] tag.
|
abstract NBTBaseTag<java.lang.Integer> |
newIntTag(int value)
Wrap the value in a int tag.
|
abstract NBTListTag |
newListTag()
Create an empty list tag.
|
abstract NBTBaseTag<java.lang.Long> |
newLongTag(long value)
Wrap the value in a long tag.
|
abstract NBTBaseTag<java.lang.Short> |
newShortTag(short value)
Wrap the value in a short tag.
|
abstract NBTBaseTag<java.lang.String> |
newStringTag(java.lang.String value)
Wrap the value in a String tag.
|
abstract NBTCompoundTag |
parse(java.lang.String serialized)
Parse the serialized form of the tag and try to build its
data representation.
|
public static TagFactory get()
TagFactory
that supports the current
server version.java.lang.UnsupportedOperationException
- if there is no support for the current version.public abstract NBTIODelegate<org.bukkit.inventory.ItemStack> getItemIODelegate()
NBTIODelegate
for ItemStack
IO tasks.public abstract NBTIODelegate<org.bukkit.entity.Entity> getEntityIODelegate()
NBTIODelegate
for Entity
IO tasks.public abstract NBTIODelegate<org.bukkit.block.BlockState> getBlockIODelegate()
BlockState
s given
to it are tile entities! There is no exposed interface in Spigot for
the sub set of BlockStates that are tile entities so it is left to the caller
to ensure this safety.NBTIODelegate
for BlockState
IO tasks.public abstract NBTIODelegate<java.io.File> getFileIODelegate()
NBTIODelegate
for File
IO tasks.public abstract NBTCompoundTag parse(java.lang.String serialized) throws NBTException
nbt_tag := nbt_compound | nbt_list | nbt_primitive ; nbt_compound := '{' (named_tag (',' named_tag)*)? '}' ; named_tag := [^:]* ':' nbt_tag ; nbt_list := '[' (nbt_tag (',' nbt_tag)*)? ']' ; nbt_primitive := nbt_double | nbt_float | nbt_byte | nbt_long | nbt_short | nbt_int | nbt_string | nbt_int_array ; nbt_double := float ('d' | 'D')? ; nbt_float := float ('f' | 'F') ; nbt_byte := int ('b' | 'B') | 'true' | 'false' ; nbt_long := int ('l' | 'L') ; nbt_short := int ('s' | 'S') ; nbt_int := int ; nbt_string := '"' ([^"] | '\"' | '\\')* '"' ; nbt_int_array := '[' (int (',' int)*)? ']' ; digit := [0-9] ; float := [-+]? digit* '.'? digit+ ; int := [-+]? digit+ ;
serialized
- the string representation of the compound tagNBTException
- if the string cannot be parsed. The cause of
the exception is the underlying parse exception.public abstract NBTBaseTag<java.lang.Byte> newByteTag(byte value)
value
- the value to wrappublic abstract NBTBaseTag<java.lang.Short> newShortTag(short value)
value
- the value to wrappublic abstract NBTBaseTag<java.lang.Integer> newIntTag(int value)
value
- the value to wrappublic abstract NBTBaseTag<java.lang.Long> newLongTag(long value)
value
- the value to wrappublic abstract NBTBaseTag<java.lang.Float> newFloatTag(float value)
value
- the value to wrappublic abstract NBTBaseTag<java.lang.Double> newDoubleTag(double value)
value
- the value to wrappublic abstract NBTBaseTag<byte[]> newByteArrayTag(byte[] value)
value
- the value to wrappublic abstract NBTBaseTag<java.lang.String> newStringTag(java.lang.String value)
value
- the value to wrappublic abstract NBTListTag newListTag()
public abstract NBTCompoundTag newCompoundTag()
public abstract NBTBaseTag<int[]> newIntArrayTag(int[] value)
value
- the value to wrap