diff --git a/Javadoc/allclasses-frame.html b/Javadoc/allclasses-frame.html index 070adfd9..de923496 100644 --- a/Javadoc/allclasses-frame.html +++ b/Javadoc/allclasses-frame.html @@ -2,9 +2,9 @@
- +StreamSerializer
getByteArraySerializer()
+StructureModifier<java.lang.Byte>
getBytes()
StructureModifier<WrappedDataWatcher>
getDataWatcherModifier()
StructureModifier<java.lang.Double>
getDoubles()
StructureModifier<org.bukkit.entity.Entity>
getEntityModifier(org.bukkit.World world)
StructureModifier<java.lang.Float>
getFloat()
java.lang.Object
getHandle()
int
getID()
StructureModifier<int[]>
getIntegerArrays()
StructureModifier<java.lang.Integer>
getIntegers()
StructureModifier<org.bukkit.inventory.ItemStack[]>
getItemArrayModifier()
StructureModifier<org.bukkit.inventory.ItemStack>
getItemModifier()
StructureModifier<java.lang.Long>
getLongs()
StructureModifier<java.lang.Object>
getModifier()
StructureModifier<NbtBase<?>>
getNbtModifier()
+StructureModifier<java.util.List<ChunkPosition>>
getPositionCollectionModifier()
@@ -582,6 +594,17 @@ implements java.io.Serializable
public StreamSerializer getByteArraySerializer()+
public StructureModifier<NbtBase<?>> getNbtModifier()+
public static class Metrics.Graph
+extends java.lang.Object
+Modifier and Type | +Method and Description | +
---|---|
void |
+addPlotter(Metrics.Plotter plotter)
+Add a plotter to the graph, which will be used to plot entries
+ |
+
boolean |
+equals(java.lang.Object object) |
+
java.lang.String |
+getName()
+Gets the graph's name
+ |
+
java.util.Set<Metrics.Plotter> |
+getPlotters()
+Gets an unmodifiable set of the plotter objects in the graph
+ |
+
int |
+hashCode() |
+
protected void |
+onOptOut()
+Called when the server owner decides to opt-out of BukkitMetrics while the server is running.
+ |
+
void |
+removePlotter(Metrics.Plotter plotter)
+Remove a plotter from the graph
+ |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public java.lang.String getName()+
public void addPlotter(Metrics.Plotter plotter)+
plotter
- the plotter to add to the graphpublic void removePlotter(Metrics.Plotter plotter)+
plotter
- the plotter to remove from the graphpublic java.util.Set<Metrics.Plotter> getPlotters()+
Set
of the plotter objectspublic int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)+
equals
in class java.lang.Object
protected void onOptOut()+
public abstract static class Metrics.Plotter
+extends java.lang.Object
+Constructor and Description | +
---|
Metrics.Plotter()
+Construct a plotter with the default plot name
+ |
+
Metrics.Plotter(java.lang.String name)
+Construct a plotter with a specific plot name
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object object) |
+
java.lang.String |
+getColumnName()
+Get the column name for the plotted point
+ |
+
abstract int |
+getValue()
+Get the current value for the plotted point.
+ |
+
int |
+hashCode() |
+
void |
+reset()
+Called after the website graphs have been updated
+ |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public Metrics.Plotter()+
public Metrics.Plotter(java.lang.String name)+
name
- the name of the plotter to use, which will show up on the websitepublic abstract int getValue()+
public java.lang.String getColumnName()+
public void reset()+
public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)+
equals
in class java.lang.Object
public class Metrics
+extends java.lang.Object
+The metrics class obtains data about a plugin and submits statistics about it to the metrics backend.
+ Public methods provided by this class:
+
+ Graph createGraph(String name);
+ void addCustomData(BukkitMetrics.Plotter plotter);
+ void start();
+
Modifier and Type | +Class and Description | +
---|---|
static class |
+Metrics.Graph
+Represents a custom graph on the website
+ |
+
static class |
+Metrics.Plotter
+Interface used to collect custom data for a plugin
+ |
+
Constructor and Description | +
---|
Metrics(org.bukkit.plugin.Plugin plugin) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addCustomData(Metrics.Plotter plotter)
+Adds a custom data plotter to the default graph
+ |
+
void |
+addGraph(Metrics.Graph graph)
+Add a Graph object to BukkitMetrics that represents data for the plugin that should be sent to the backend
+ |
+
Metrics.Graph |
+createGraph(java.lang.String name)
+Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
+ website.
+ |
+
void |
+disable()
+Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
+ |
+
void |
+enable()
+Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
+ |
+
java.io.File |
+getConfigFile()
+Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
+ |
+
boolean |
+isOptOut()
+Has the server owner denied plugin metrics?
+ |
+
boolean |
+start()
+Start measuring statistics.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Metrics(org.bukkit.plugin.Plugin plugin) + throws java.io.IOException+
java.io.IOException
public Metrics.Graph createGraph(java.lang.String name)+
name
- The name of the graphpublic void addGraph(Metrics.Graph graph)+
graph
- The name of the graphpublic void addCustomData(Metrics.Plotter plotter)+
plotter
- The plotter to use to plot custom datapublic boolean start()+
public boolean isOptOut()+
public void enable() + throws java.io.IOException+
java.io.IOException
public void disable() + throws java.io.IOException+
java.io.IOException
public java.io.File getConfigFile()+
static java.lang.String
printObject(java.lang.Object object)
+static java.lang.String
printObject(java.lang.Object object,
java.lang.Class<?> start,
java.lang.Class<?> stop)
static java.lang.String
printObject(java.lang.Object object,
java.lang.Class<?> start,
@@ -232,6 +238,21 @@ extends java.lang.Object
Method Detail
+
+
+
+
+-
+
printObject
+public static java.lang.String printObject(java.lang.Object object)
+ throws java.lang.IllegalAccessException
+Print the content of an object.
+- Parameters:
object
- - the object to serialize.stop
- - superclass that will stop the process.
+- Returns:
- String representation of the class.
+- Throws:
+java.lang.IllegalAccessException
+
+
diff --git a/Javadoc/com/comphenix/protocol/reflect/StructureModifier.html b/Javadoc/com/comphenix/protocol/reflect/StructureModifier.html
index d36b4754..d89fe4ce 100644
--- a/Javadoc/com/comphenix/protocol/reflect/StructureModifier.html
+++ b/Javadoc/com/comphenix/protocol/reflect/StructureModifier.html
@@ -2,9 +2,9 @@
-
+
StructureModifier
-
+
diff --git a/Javadoc/com/comphenix/protocol/reflect/VolatileField.html b/Javadoc/com/comphenix/protocol/reflect/VolatileField.html
index 98534d2a..c20df988 100644
--- a/Javadoc/com/comphenix/protocol/reflect/VolatileField.html
+++ b/Javadoc/com/comphenix/protocol/reflect/VolatileField.html
@@ -2,9 +2,9 @@
-
+
VolatileField
-
+
diff --git a/Javadoc/com/comphenix/protocol/reflect/class-use/EquivalentConverter.html b/Javadoc/com/comphenix/protocol/reflect/class-use/EquivalentConverter.html
index f4911527..4b189de6 100644
--- a/Javadoc/com/comphenix/protocol/reflect/class-use/EquivalentConverter.html
+++ b/Javadoc/com/comphenix/protocol/reflect/class-use/EquivalentConverter.html
@@ -2,9 +2,9 @@
-
+
Uses of Interface com.comphenix.protocol.reflect.EquivalentConverter
-
+
@@ -207,12 +207,18 @@
EquivalentConverter<T> itemConverter)
static EquivalentConverter<NbtBase<?>>
getNbtConverter()
+static EquivalentConverter<WrappedWatchableObject>
getWatchableObjectConverter()
static EquivalentConverter<org.bukkit.WorldType>
getWorldTypeConverter()
StructureModifier<NbtBase<?>>
getNbtModifier()
+StructureModifier<java.util.List<ChunkPosition>>
getPositionCollectionModifier()
StructureModifier<ChunkPosition>
getPositionModifier()
StructureModifier<java.lang.Short>
getShorts()
<T> StructureModifier<T>
getSpecificModifier(java.lang.Class<T> primitiveType)
StructureModifier<java.lang.String[]>
getStringArrays()
StructureModifier<java.lang.String>
getStrings()
StructureModifier<java.util.List<WrappedWatchableObject>>
getWatchableCollectionModifier()
StructureModifier<org.bukkit.WorldType>
getWorldTypeModifier()
<TField> boolean
lookupClassLoader(StructureModifier<TField> source)
+void
onCompiled(StructureModifier<TKey> compiledModifier)
<TKey> void
scheduleCompilation(StructureModifier<TKey> uncompiled,
CompileListener<TKey> listener)
diff --git a/Javadoc/com/comphenix/protocol/reflect/class-use/VolatileField.html b/Javadoc/com/comphenix/protocol/reflect/class-use/VolatileField.html
index cd52fa21..1f52b0ee 100644
--- a/Javadoc/com/comphenix/protocol/reflect/class-use/VolatileField.html
+++ b/Javadoc/com/comphenix/protocol/reflect/class-use/VolatileField.html
@@ -2,9 +2,9 @@
-
+
<TField> boolean
lookupClassLoader(StructureModifier<TField> source)
+public <TField> boolean lookupClassLoader(StructureModifier<TField> source)+
source
- - the structure modifier to look up.Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
Class and Description | +
---|
StreamSerializer
+ Utility methods for reading and writing Minecraft objects to streams.
+ |
+
static EquivalentConverter<NbtBase<?>>
getNbtConverter()
+static EquivalentConverter<WrappedWatchableObject>
getWatchableObjectConverter()
static EquivalentConverter<org.bukkit.WorldType>
getWorldTypeConverter()
public static EquivalentConverter<NbtBase<?>> getNbtConverter()+
TType
- - type of the value that is stored.public interface NbtBase<TType>
+
+ Use NbtFactory
to load or create an instance.
Modifier and Type | +Method and Description | +
---|---|
boolean |
+accept(NbtVisitor visitor)
+Accepts a NBT visitor.
+ |
+
NbtBase<TType> |
+deepClone()
+Clone the current NBT tag.
+ |
+
java.lang.String |
+getName()
+Retrieve the name of this NBT tag.
+ |
+
NbtType |
+getType()
+Retrieve the type of this NBT element.
+ |
+
TType |
+getValue()
+Retrieve the value of this NBT tag.
+ |
+
void |
+setName(java.lang.String name)
+Set the name of this NBT tag.
+ |
+
void |
+setValue(TType newValue)
+Set the value of this NBT tag.
+ |
+
boolean accept(NbtVisitor visitor)+
visitor
- - the hierarchical NBT visitor.NbtType getType()+
java.lang.String getName()+
+ This will be an empty string if the NBT tag is stored in a list.
void setName(java.lang.String name)+
+ This will be ignored if the NBT tag is stored in a list.
name
- - name of the tag.TType getValue()+
+ Is either a primitive wrapper
, String
,
+ List
or a Map
.
+
+ All operations that modify collections directly, such as List.add(Object)
or
+ Map.clear()
, are considered optional. This also include members in Iterator
and
+ ListIterator
. Operations that are not implemented throw a
+ UnsupportedOperationException
.
void setValue(TType newValue)+
newValue
- - the new value of this tag.public interface NbtCompound +extends NbtBase<java.util.Map<java.lang.String,NbtBase<?>>>, java.lang.Iterable<NbtBase<?>>+
+ Use NbtFactory
to load or create an instance.
+
+ The NbtBase.getValue()
method returns a Map
that will return the full content
+ of this NBT compound, but may throw an UnsupportedOperationException
for any of the write operations.
Modifier and Type | +Method and Description | +
---|---|
boolean |
+containsKey(java.lang.String key)
+Determine if an entry with the given key exists or not.
+ |
+
byte |
+getByte(java.lang.String key)
+Retrieve the byte value of an entry identified by a given key.
+ |
+
byte[] |
+getByteArray(java.lang.String key)
+Retrieve the byte array value of an entry identified by a given key.
+ |
+
byte |
+getByteOrDefault(java.lang.String key)
+Retrieve the byte value of an existing entry, or from a new default entry if it doesn't exist.
+ |
+
NbtCompound |
+getCompound(java.lang.String key)
+Retrieve the compound (map) value of an entry identified by a given key.
+ |
+
NbtCompound |
+getCompoundOrDefault(java.lang.String key)
+Retrieve a compound (map) value by its key, or create a new compound if it doesn't exist.
+ |
+
double |
+getDouble(java.lang.String key)
+Retrieve the double value of an entry identified by a given key.
+ |
+
double |
+getDoubleOrDefault(java.lang.String key)
+Retrieve the double value of an existing entry, or from a new default entry if it doesn't exist.
+ |
+
float |
+getFloat(java.lang.String key)
+Retrieve the float value of an entry identified by a given key.
+ |
+
float |
+getFloatOrDefault(java.lang.String key)
+Retrieve the float value of an existing entry, or from a new default entry if it doesn't exist.
+ |
+
int |
+getInteger(java.lang.String key)
+Retrieve the integer value of an entry identified by a given key.
+ |
+
int[] |
+getIntegerArray(java.lang.String key)
+Retrieve the integer array value of an entry identified by a given key.
+ |
+
int |
+getIntegerOrDefault(java.lang.String key)
+Retrieve the integer value of an existing entry, or from a new default entry if it doesn't exist.
+ |
+
java.util.Set<java.lang.String> |
+getKeys()
+Retrieve a Set view of the keys of each entry in this compound.
+ |
+
<T> NbtList<T> |
+getList(java.lang.String key)
+Retrieve the NBT list value of an entry identified by a given key.
+ |
+
<T> NbtList<T> |
+getListOrDefault(java.lang.String key)
+Retrieve a NBT list value by its key, or create a new list if it doesn't exist.
+ |
+
long |
+getLong(java.lang.String key)
+Retrieve the long value of an entry identified by a given key.
+ |
+
long |
+getLongOrDefault(java.lang.String key)
+Retrieve the long value of an existing entry, or from a new default entry if it doesn't exist.
+ |
+
java.lang.Short |
+getShort(java.lang.String key)
+Retrieve the short value of an entry identified by a given key.
+ |
+
short |
+getShortOrDefault(java.lang.String key)
+Retrieve the short value of an existing entry, or from a new default entry if it doesn't exist.
+ |
+
java.lang.String |
+getString(java.lang.String key)
+Retrieve the string value of an entry identified by a given key.
+ |
+
java.lang.String |
+getStringOrDefault(java.lang.String key)
+Retrieve the string value of an existing entry, or from a new default entry if it doesn't exist.
+ |
+
<T> NbtBase<T> |
+getValue(java.lang.String key)
+Retrieve the value of a given entry.
+ |
+
NbtBase<?> |
+getValueOrDefault(java.lang.String key,
+ NbtType type)
+Retrieve a value by its key, or assign and return a new NBT element if it doesn't exist.
+ |
+
java.util.Iterator<NbtBase<?>> |
+iterator()
+Retrieve an iterator view of the NBT tags stored in this compound.
+ |
+
<T> NbtCompound |
+put(NbtBase<T> entry)
+Set a entry based on its name.
+ |
+
<T> NbtCompound |
+put(NbtList<T> list)
+Associate a NBT list with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ byte value)
+Associate a NBT byte value with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ byte[] value)
+Associate a NBT byte array value with the given key.
+ |
+
<T> NbtCompound |
+put(java.lang.String key,
+ java.util.Collection<? extends NbtBase<T>> list)
+Associate a new NBT list with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ double value)
+Associate a NBT double value with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ float value)
+Associate a NBT float value with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ int value)
+Associate a NBT integer value with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ int[] value)
+Associate a NBT integer array value with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ long value)
+Associate a NBT long value with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ NbtBase<?> entry)
+Inserts an entry after cloning it and renaming it to "key".
+ |
+
NbtCompound |
+put(java.lang.String key,
+ short value)
+Associate a NBT short value with the given key.
+ |
+
NbtCompound |
+put(java.lang.String key,
+ java.lang.String value)
+Associate a NBT string value with the given key.
+ |
+
NbtCompound |
+put(com.comphenix.protocol.wrappers.nbt.WrappedCompound compound)
+Associate a NBT compound with its name as key.
+ |
+
boolean containsKey(java.lang.String key)+
key
- - the key to lookup.java.util.Set<java.lang.String> getKeys()+
<T> NbtBase<T> getValue(java.lang.String key)+
key
- - key of the entry to retrieve.NbtBase<?> getValueOrDefault(java.lang.String key, + NbtType type)+
key
- - the key of the entry to find or create.type
- - the NBT element we will create if not found.<T> NbtCompound put(NbtBase<T> entry)+
entry
- - entry with a name and value.java.lang.String getString(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.java.lang.String getStringOrDefault(java.lang.String key)+
key
- - the key of the entry.NbtCompound put(java.lang.String key, + java.lang.String value)+
key
- - the key and NBT name.value
- - the value.NbtCompound put(java.lang.String key, + NbtBase<?> entry)+
key
- - the name of the entry.entry
- - the entry to insert.byte getByte(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.byte getByteOrDefault(java.lang.String key)+
key
- - the key of the entry.NbtCompound put(java.lang.String key, + byte value)+
key
- - the key and NBT name.value
- - the value.java.lang.Short getShort(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.short getShortOrDefault(java.lang.String key)+
key
- - the key of the entry.NbtCompound put(java.lang.String key, + short value)+
key
- - the key and NBT name.value
- - the value.int getInteger(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.int getIntegerOrDefault(java.lang.String key)+
key
- - the key of the entry.NbtCompound put(java.lang.String key, + int value)+
key
- - the key and NBT name.value
- - the value.long getLong(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.long getLongOrDefault(java.lang.String key)+
key
- - the key of the entry.NbtCompound put(java.lang.String key, + long value)+
key
- - the key and NBT name.value
- - the value.float getFloat(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.float getFloatOrDefault(java.lang.String key)+
key
- - the key of the entry.NbtCompound put(java.lang.String key, + float value)+
key
- - the key and NBT name.value
- - the value.double getDouble(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.double getDoubleOrDefault(java.lang.String key)+
key
- - the key of the entry.NbtCompound put(java.lang.String key, + double value)+
key
- - the key and NBT name.value
- - the value.byte[] getByteArray(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.NbtCompound put(java.lang.String key, + byte[] value)+
key
- - the key and NBT name.value
- - the value.int[] getIntegerArray(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.NbtCompound put(java.lang.String key, + int[] value)+
key
- - the key and NBT name.value
- - the value.NbtCompound getCompound(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.NbtCompound getCompoundOrDefault(java.lang.String key)+
key
- - the key of the entry to find or create.NbtCompound put(com.comphenix.protocol.wrappers.nbt.WrappedCompound compound)+
compound
- - the compound value.<T> NbtList<T> getList(java.lang.String key)+
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.<T> NbtList<T> getListOrDefault(java.lang.String key)+
key
- - the key of the entry to find or create.<T> NbtCompound put(NbtList<T> list)+
list
- - the list value.<T> NbtCompound put(java.lang.String key, + java.util.Collection<? extends NbtBase<T>> list)+
key
- - the key and name of the new NBT list.list
- - the list of NBT elements.public class NbtFactory
+extends java.lang.Object
+Constructor and Description | +
---|
NbtFactory() |
+
Modifier and Type | +Method and Description | +
---|---|
static NbtCompound |
+asCompound(NbtBase<?> tag)
+Attempt to cast this NBT tag as a compund.
+ |
+
static NbtList<?> |
+asList(NbtBase<?> tag)
+Attempt to cast this NBT tag as a list.
+ |
+
static <T> NbtWrapper<T> |
+fromBase(NbtBase<T> base)
+Get a NBT wrapper from a NBT base.
+ |
+
static NbtWrapper<?> |
+fromItemTag(org.bukkit.inventory.ItemStack stack)
+Construct a wrapper for an NBT tag stored (in memory) in an item stack.
+ |
+
static <T> NbtWrapper<T> |
+fromNMS(java.lang.Object handle)
+Initialize a NBT wrapper.
+ |
+
static NbtBase<java.lang.Byte> |
+of(java.lang.String name,
+ byte value)
+Constructs a NBT tag of type byte.
+ |
+
static NbtBase<byte[]> |
+of(java.lang.String name,
+ byte[] value)
+Constructs a NBT tag of type byte array.
+ |
+
static NbtBase<java.lang.Double> |
+of(java.lang.String name,
+ double value)
+Constructs a NBT tag of type double.
+ |
+
static NbtBase<java.lang.Float> |
+of(java.lang.String name,
+ float value)
+Constructs a NBT tag of type float.
+ |
+
static NbtBase<java.lang.Integer> |
+of(java.lang.String name,
+ int value)
+Constructs a NBT tag of type int.
+ |
+
static NbtBase<int[]> |
+of(java.lang.String name,
+ int[] value)
+Constructs a NBT tag of type int array.
+ |
+
static NbtBase<java.lang.Long> |
+of(java.lang.String name,
+ long value)
+Constructs a NBT tag of type long.
+ |
+
static NbtBase<java.lang.Short> |
+of(java.lang.String name,
+ short value)
+Constructs a NBT tag of type short.
+ |
+
static NbtBase<java.lang.String> |
+of(java.lang.String name,
+ java.lang.String value)
+Constructs a NBT tag of type string.
+ |
+
static NbtCompound |
+ofCompound(java.lang.String name)
+Construct a new NBT compound wrapper.
+ |
+
static NbtCompound |
+ofCompound(java.lang.String name,
+ java.util.Collection<? extends NbtBase<?>> list)
+Construct a new NBT compound initialized with a given list of NBT values.
+ |
+
static <T> NbtList<T> |
+ofList(java.lang.String name,
+ java.util.Collection<? extends T> elements)
+Construct a NBT list of out a list of values.
+ |
+
static <T> NbtList<T> |
+ofList(java.lang.String name,
+ T... elements)
+Construct a NBT list of out an array of values.
+ |
+
static <T> NbtWrapper<T> |
+ofWrapper(java.lang.Class<?> type,
+ java.lang.String name,
+ T value)
+Create a new NBT wrapper from a given type.
+ |
+
static <T> NbtWrapper<T> |
+ofWrapper(NbtType type,
+ java.lang.String name)
+Create a new NBT wrapper from a given type.
+ |
+
static <T> NbtWrapper<T> |
+ofWrapper(NbtType type,
+ java.lang.String name,
+ T value)
+Create a new NBT wrapper from a given type.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static NbtCompound asCompound(NbtBase<?> tag)+
tag
- - the NBT tag to cast.java.lang.UnsupportedOperationException
- If this is not a compound.public static NbtList<?> asList(NbtBase<?> tag)+
tag
- - the NBT tag to cast.java.lang.UnsupportedOperationException
- If this is not a list.public static <T> NbtWrapper<T> fromBase(NbtBase<T> base)+
+ This may clone the content if the NbtBase is not a NbtWrapper.
base
- - the base class.public static NbtWrapper<?> fromItemTag(org.bukkit.inventory.ItemStack stack)+
+ The item stack must be a wrapper for a CraftItemStack. Use
+ MinecraftReflection.getBukkitItemStack(ItemStack)
if not.
stack
- - the item stack.public static <T> NbtWrapper<T> fromNMS(java.lang.Object handle)+
handle
- - the underlying net.minecraft.server object to wrap.public static NbtBase<java.lang.String> of(java.lang.String name, + java.lang.String value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Byte> of(java.lang.String name, + byte value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Short> of(java.lang.String name, + short value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Integer> of(java.lang.String name, + int value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Long> of(java.lang.String name, + long value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Float> of(java.lang.String name, + float value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Double> of(java.lang.String name, + double value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<byte[]> of(java.lang.String name, + byte[] value)+
name
- - name of the tag.value
- - value of the tag.public static NbtBase<int[]> of(java.lang.String name, + int[] value)+
name
- - name of the tag.value
- - value of the tag.public static NbtCompound ofCompound(java.lang.String name, + java.util.Collection<? extends NbtBase<?>> list)+
name
- - the name of the compound wrapper.list
- - the list of elements to add.public static NbtCompound ofCompound(java.lang.String name)+
name
- - the name of the compound wrapper.public static <T> NbtList<T> ofList(java.lang.String name, + T... elements)+
name
- - name of this list.elements
- - elements to add.public static <T> NbtList<T> ofList(java.lang.String name, + java.util.Collection<? extends T> elements)+
name
- - name of this list.elements
- - elements to add.public static <T> NbtWrapper<T> ofWrapper(NbtType type, + java.lang.String name)+
type
- - the NBT type.name
- - the name of the NBT tag.FieldAccessException
- If we're unable to create the underlying tag.public static <T> NbtWrapper<T> ofWrapper(NbtType type, + java.lang.String name, + T value)+
type
- - the NBT type.name
- - the name of the NBT tag.value
- - the value of the new tag.FieldAccessException
- If we're unable to create the underlying tag.public static <T> NbtWrapper<T> ofWrapper(java.lang.Class<?> type, + java.lang.String name, + T value)+
type
- - type of the NBT value.name
- - the name of the NBT tag.value
- - the value of the new tag.FieldAccessException
- If we're unable to create the underlying tag.java.lang.IllegalArgumentException
- If the given class type is not valid NBT.TType
- - the value type of each NBT tag.public interface NbtList<TType> +extends NbtBase<java.util.List<NbtBase<TType>>>, java.lang.Iterable<TType>+
+ Use NbtFactory
to load or create an instance.
+
+ The NbtBase.getValue()
method returns a List
that will correctly return the content
+ of this NBT list, but may throw an UnsupportedOperationException
for any of the write operations.
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+EMPTY_NAME
+The name of every NBT tag in a list.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+add(byte value)
+Add a new byte element to the list.
+ |
+
void |
+add(byte[] value)
+Add a new byte array element to the list.
+ |
+
void |
+add(double value)
+Add a new double element to the list.
+ |
+
void |
+add(int value)
+Add a new integer element to the list.
+ |
+
void |
+add(int[] value)
+Add a new int array element to the list.
+ |
+
void |
+add(long value)
+Add a new long element to the list.
+ |
+
void |
+add(NbtBase<TType> element)
+Add a NBT list or NBT compound to the list.
+ |
+
void |
+add(short value)
+Add a new short element to the list.
+ |
+
void |
+add(java.lang.String value)
+Add a new string element to the list.
+ |
+
void |
+addClosest(java.lang.Object value)
+Add a value to a typed list by attempting to convert it to the nearest value.
+ |
+
java.util.Collection<NbtBase<TType>> |
+asCollection()
+Retrieve each NBT tag in this list.
+ |
+
NbtType |
+getElementType()
+Get the type of each element.
+ |
+
TType |
+getValue(int index)
+Retrieve an element by index.
+ |
+
java.util.Iterator<TType> |
+iterator()
+Iterate over all the elements in this list.
+ |
+
void |
+remove(java.lang.Object remove)
+Remove a given object from the list.
+ |
+
void |
+setElementType(NbtType type)
+Set the type of each element.
+ |
+
int |
+size()
+Retrieve the number of elements in this list.
+ |
+
static final java.lang.String EMPTY_NAME+
NbtType getElementType()+
+ This will be TAG_END
if the NBT list has just been created.
void setElementType(NbtType type)+
type
- - type of each element.void addClosest(java.lang.Object value)+
+ Note that the list must be typed by setting setElementType(NbtType)
before calling this function.
value
- - the value to add.void add(NbtBase<TType> element)+
element
- void add(java.lang.String value)+
value
- - the string element to add.java.lang.IllegalArgumentException
- If this is not a list of strings.void add(byte value)+
value
- - the byte element to add.java.lang.IllegalArgumentException
- If this is not a list of bytes.void add(short value)+
value
- - the short element to add.java.lang.IllegalArgumentException
- If this is not a list of shorts.void add(int value)+
value
- - the string element to add.java.lang.IllegalArgumentException
- If this is not a list of integers.void add(long value)+
value
- - the string element to add.java.lang.IllegalArgumentException
- If this is not a list of longs.void add(double value)+
value
- - the double element to add.java.lang.IllegalArgumentException
- If this is not a list of doubles.void add(byte[] value)+
value
- - the byte array element to add.java.lang.IllegalArgumentException
- If this is not a list of byte arrays.void add(int[] value)+
value
- - the int array element to add.java.lang.IllegalArgumentException
- If this is not a list of int arrays.void remove(java.lang.Object remove)+
remove
- - the object to remove.TType getValue(int index)+
index
- - index of the element to retrieve.java.lang.IndexOutOfBoundsException
- If the index is out of range (index < 0 || index >= size())int size()+
java.util.Collection<NbtBase<TType>> asCollection()+
Enum Constant and Description | +
---|
TAG_BYTE
+A signed 1 byte integral type.
+ |
+
TAG_BYTE_ARRAY
+An array of bytes.
+ |
+
TAG_COMPOUND
+A list of fully formed tags, including their IDs, names, and payloads.
+ |
+
TAG_DOUBLE
+A signed 8 byte floating point type.
+ |
+
TAG_END
+Used to mark the end of compound tags.
+ |
+
TAG_FLOAT
+A signed 4 byte floating point type.
+ |
+
TAG_INT
+A signed 4 byte integral type.
+ |
+
TAG_INT_ARRAY
+An array of TAG_Int's payloads..
+ |
+
TAG_LIST
+A list of tag payloads, without repeated tag IDs or any tag names.
+ |
+
TAG_LONG
+A signed 8 byte integral type.
+ |
+
TAG_SHORT
+A signed 2 byte integral type.
+ |
+
TAG_STRING
+A UTF-8 string
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+getRawID()
+Retrieves the raw unique integer that identifies the type of the parent NBT element.
+ |
+
static NbtType |
+getTypeFromClass(java.lang.Class<?> clazz)
+Retrieve an NBT type from the given Java class.
+ |
+
static NbtType |
+getTypeFromID(int rawID)
+Retrieve an NBT type from a given raw ID.
+ |
+
java.lang.Class<?> |
+getValueType()
+Retrieves the type of the value stored in the NBT element.
+ |
+
boolean |
+isComposite()
+Determine if the given NBT can store multiple children NBT tags.
+ |
+
static NbtType |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static NbtType[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final NbtType TAG_END+
public static final NbtType TAG_BYTE+
public static final NbtType TAG_SHORT+
public static final NbtType TAG_INT+
public static final NbtType TAG_LONG+
public static final NbtType TAG_FLOAT+
public static final NbtType TAG_DOUBLE+
public static final NbtType TAG_BYTE_ARRAY+
public static final NbtType TAG_INT_ARRAY+
public static final NbtType TAG_STRING+
public static final NbtType TAG_LIST+
public static final NbtType TAG_COMPOUND+
public static NbtType[] values()+
+for (NbtType c : NbtType.values()) + System.out.println(c); +
public static NbtType valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
+with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isComposite()+
public int getRawID()+
public java.lang.Class<?> getValueType()+
public static NbtType getTypeFromID(int rawID)+
rawID
- - the raw ID to lookup.public static NbtType getTypeFromClass(java.lang.Class<?> clazz)+
clazz
- - type of the value the NBT type can contain.java.lang.IllegalArgumentException
- If this class type cannot be represented by NBT tags.public interface NbtVisitor
+Modifier and Type | +Method and Description | +
---|---|
boolean |
+visit(NbtBase<?> node)
+Visit a leaf node, which is a NBT tag with a primitive or String value.
+ |
+
boolean |
+visitEnter(NbtCompound compound)
+Begin visiting a compound node that contains multiple child nodes of different types.
+ |
+
boolean |
+visitEnter(NbtList<?> list)
+Begin visiting a list node that contains multiple child nodes of the same type.
+ |
+
boolean |
+visitLeave(NbtCompound compound)
+Stop visiting a compound node.
+ |
+
boolean |
+visitLeave(NbtList<?> list)
+Stop visiting a list node.
+ |
+
boolean visit(NbtBase<?> node)+
node
- - the visited leaf node.boolean visitEnter(NbtList<?> list)+
list
- - the NBT tag to process.boolean visitEnter(NbtCompound compound)+
compound
- - the NBT tag to process.boolean visitLeave(NbtList<?> list)+
list
- - the list we're done visiting.boolean visitLeave(NbtCompound compound)+
compound
- - the compound we're done visting.TType
- - type of the value that is stored.public interface NbtWrapper<TType> +extends NbtBase<TType>+
+ Use NbtFactory
to load or create instances.
java.lang.Object getHandle()+
void write(java.io.DataOutput destination)+
destination
- - the destination stream.Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.wrappers | ++ |
com.comphenix.protocol.wrappers.nbt | ++ |
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Method and Description | +
---|---|
StructureModifier<NbtBase<?>> |
+PacketContainer.getNbtModifier()
+Retrieves a read/write structure for NBT classes.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static EquivalentConverter<NbtBase<?>> |
+BukkitConverters.getNbtConverter()
+Retrieve an equivalent converter for net.minecraft.server NBT classes and their wrappers.
+ |
+
Modifier and Type | +Interface and Description | +
---|---|
interface |
+NbtCompound
+Represents a mapping of arbitrary NBT elements and their unique names.
+ |
+
interface |
+NbtList<TType>
+Represents a list of NBT tags of the same type without names.
+ |
+
interface |
+NbtWrapper<TType>
+Indicates that this NBT wraps an underlying net.minecraft.server instance.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
NbtBase<TType> |
+NbtBase.deepClone()
+Clone the current NBT tag.
+ |
+
<T> NbtBase<T> |
+NbtCompound.getValue(java.lang.String key)
+Retrieve the value of a given entry.
+ |
+
NbtBase<?> |
+NbtCompound.getValueOrDefault(java.lang.String key,
+ NbtType type)
+Retrieve a value by its key, or assign and return a new NBT element if it doesn't exist.
+ |
+
static NbtBase<java.lang.Byte> |
+NbtFactory.of(java.lang.String name,
+ byte value)
+Constructs a NBT tag of type byte.
+ |
+
static NbtBase<byte[]> |
+NbtFactory.of(java.lang.String name,
+ byte[] value)
+Constructs a NBT tag of type byte array.
+ |
+
static NbtBase<java.lang.Double> |
+NbtFactory.of(java.lang.String name,
+ double value)
+Constructs a NBT tag of type double.
+ |
+
static NbtBase<java.lang.Float> |
+NbtFactory.of(java.lang.String name,
+ float value)
+Constructs a NBT tag of type float.
+ |
+
static NbtBase<java.lang.Integer> |
+NbtFactory.of(java.lang.String name,
+ int value)
+Constructs a NBT tag of type int.
+ |
+
static NbtBase<int[]> |
+NbtFactory.of(java.lang.String name,
+ int[] value)
+Constructs a NBT tag of type int array.
+ |
+
static NbtBase<java.lang.Long> |
+NbtFactory.of(java.lang.String name,
+ long value)
+Constructs a NBT tag of type long.
+ |
+
static NbtBase<java.lang.Short> |
+NbtFactory.of(java.lang.String name,
+ short value)
+Constructs a NBT tag of type short.
+ |
+
static NbtBase<java.lang.String> |
+NbtFactory.of(java.lang.String name,
+ java.lang.String value)
+Constructs a NBT tag of type string.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
java.util.Collection<NbtBase<TType>> |
+NbtList.asCollection()
+Retrieve each NBT tag in this list.
+ |
+
java.util.Iterator<NbtBase<?>> |
+NbtCompound.iterator()
+Retrieve an iterator view of the NBT tags stored in this compound.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+NbtList.add(NbtBase<TType> element)
+Add a NBT list or NBT compound to the list.
+ |
+
static NbtCompound |
+NbtFactory.asCompound(NbtBase<?> tag)
+Attempt to cast this NBT tag as a compund.
+ |
+
static NbtList<?> |
+NbtFactory.asList(NbtBase<?> tag)
+Attempt to cast this NBT tag as a list.
+ |
+
static <T> NbtWrapper<T> |
+NbtFactory.fromBase(NbtBase<T> base)
+Get a NBT wrapper from a NBT base.
+ |
+
<T> NbtCompound |
+NbtCompound.put(NbtBase<T> entry)
+Set a entry based on its name.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ NbtBase<?> entry)
+Inserts an entry after cloning it and renaming it to "key".
+ |
+
boolean |
+NbtVisitor.visit(NbtBase<?> node)
+Visit a leaf node, which is a NBT tag with a primitive or String value.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static NbtCompound |
+NbtFactory.ofCompound(java.lang.String name,
+ java.util.Collection<? extends NbtBase<?>> list)
+Construct a new NBT compound initialized with a given list of NBT values.
+ |
+
<T> NbtCompound |
+NbtCompound.put(java.lang.String key,
+ java.util.Collection<? extends NbtBase<T>> list)
+Associate a new NBT list with the given key.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
<TType> java.lang.String |
+NbtTextSerializer.serialize(NbtBase<TType> value)
+Serialize a NBT tag to a base-64 encoded string.
+ |
+
<TType> void |
+NbtConfigurationSerializer.serialize(NbtBase<TType> value,
+ org.bukkit.configuration.ConfigurationSection destination)
+Write the content of a NBT tag to a configuration section.
+ |
+
<TType> void |
+NbtBinarySerializer.serialize(NbtBase<TType> value,
+ java.io.DataOutput destination)
+Write the content of a wrapped NBT tag to a stream.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt | ++ |
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Method and Description | +
---|---|
static NbtCompound |
+NbtFactory.asCompound(NbtBase<?> tag)
+Attempt to cast this NBT tag as a compund.
+ |
+
NbtCompound |
+NbtCompound.getCompound(java.lang.String key)
+Retrieve the compound (map) value of an entry identified by a given key.
+ |
+
NbtCompound |
+NbtCompound.getCompoundOrDefault(java.lang.String key)
+Retrieve a compound (map) value by its key, or create a new compound if it doesn't exist.
+ |
+
static NbtCompound |
+NbtFactory.ofCompound(java.lang.String name)
+Construct a new NBT compound wrapper.
+ |
+
static NbtCompound |
+NbtFactory.ofCompound(java.lang.String name,
+ java.util.Collection<? extends NbtBase<?>> list)
+Construct a new NBT compound initialized with a given list of NBT values.
+ |
+
<T> NbtCompound |
+NbtCompound.put(NbtBase<T> entry)
+Set a entry based on its name.
+ |
+
<T> NbtCompound |
+NbtCompound.put(NbtList<T> list)
+Associate a NBT list with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ byte value)
+Associate a NBT byte value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ byte[] value)
+Associate a NBT byte array value with the given key.
+ |
+
<T> NbtCompound |
+NbtCompound.put(java.lang.String key,
+ java.util.Collection<? extends NbtBase<T>> list)
+Associate a new NBT list with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ double value)
+Associate a NBT double value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ float value)
+Associate a NBT float value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ int value)
+Associate a NBT integer value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ int[] value)
+Associate a NBT integer array value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ long value)
+Associate a NBT long value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ NbtBase<?> entry)
+Inserts an entry after cloning it and renaming it to "key".
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ short value)
+Associate a NBT short value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(java.lang.String key,
+ java.lang.String value)
+Associate a NBT string value with the given key.
+ |
+
NbtCompound |
+NbtCompound.put(com.comphenix.protocol.wrappers.nbt.WrappedCompound compound)
+Associate a NBT compound with its name as key.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+NbtVisitor.visitEnter(NbtCompound compound)
+Begin visiting a compound node that contains multiple child nodes of different types.
+ |
+
boolean |
+NbtVisitor.visitLeave(NbtCompound compound)
+Stop visiting a compound node.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
NbtCompound |
+NbtBinarySerializer.deserializeCompound(java.io.DataInput source)
+Load an NBT compound from a stream.
+ |
+
NbtCompound |
+NbtTextSerializer.deserializeCompound(java.lang.String input)
+Deserialize a NBT compound from a base-64 encoded string.
+ |
+
NbtCompound |
+NbtConfigurationSerializer.deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root,
+ java.lang.String nodeName)
+Read a NBT compound from a root configuration.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt | ++ |
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Method and Description | +
---|---|
static NbtList<?> |
+NbtFactory.asList(NbtBase<?> tag)
+Attempt to cast this NBT tag as a list.
+ |
+
<T> NbtList<T> |
+NbtCompound.getList(java.lang.String key)
+Retrieve the NBT list value of an entry identified by a given key.
+ |
+
<T> NbtList<T> |
+NbtCompound.getListOrDefault(java.lang.String key)
+Retrieve a NBT list value by its key, or create a new list if it doesn't exist.
+ |
+
static <T> NbtList<T> |
+NbtFactory.ofList(java.lang.String name,
+ java.util.Collection<? extends T> elements)
+Construct a NBT list of out a list of values.
+ |
+
static <T> NbtList<T> |
+NbtFactory.ofList(java.lang.String name,
+ T... elements)
+Construct a NBT list of out an array of values.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
<T> NbtCompound |
+NbtCompound.put(NbtList<T> list)
+Associate a NBT list with the given key.
+ |
+
boolean |
+NbtVisitor.visitEnter(NbtList<?> list)
+Begin visiting a list node that contains multiple child nodes of the same type.
+ |
+
boolean |
+NbtVisitor.visitLeave(NbtList<?> list)
+Stop visiting a list node.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
<T> NbtList<T> |
+NbtBinarySerializer.deserializeList(java.io.DataInput source)
+Load an NBT list from a stream.
+ |
+
<T> NbtList<T> |
+NbtTextSerializer.deserializeList(java.lang.String input)
+Deserialize a NBT list from a base-64 encoded string.
+ |
+
<T> NbtList<T> |
+NbtConfigurationSerializer.deserializeList(org.bukkit.configuration.file.YamlConfiguration root,
+ java.lang.String nodeName)
+Read a NBT compound from a root configuration.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt | ++ |
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Method and Description | +
---|---|
NbtType |
+NbtList.getElementType()
+Get the type of each element.
+ |
+
NbtType |
+NbtBase.getType()
+Retrieve the type of this NBT element.
+ |
+
static NbtType |
+NbtType.getTypeFromClass(java.lang.Class<?> clazz)
+Retrieve an NBT type from the given Java class.
+ |
+
static NbtType |
+NbtType.getTypeFromID(int rawID)
+Retrieve an NBT type from a given raw ID.
+ |
+
static NbtType |
+NbtType.valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static NbtType[] |
+NbtType.values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
NbtBase<?> |
+NbtCompound.getValueOrDefault(java.lang.String key,
+ NbtType type)
+Retrieve a value by its key, or assign and return a new NBT element if it doesn't exist.
+ |
+
static <T> NbtWrapper<T> |
+NbtFactory.ofWrapper(NbtType type,
+ java.lang.String name)
+Create a new NBT wrapper from a given type.
+ |
+
static <T> NbtWrapper<T> |
+NbtFactory.ofWrapper(NbtType type,
+ java.lang.String name,
+ T value)
+Create a new NBT wrapper from a given type.
+ |
+
void |
+NbtList.setElementType(NbtType type)
+Set the type of each element.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.Object |
+NbtConfigurationSerializer.toNodeValue(java.lang.Object value,
+ NbtType type) |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt | ++ |
Modifier and Type | +Method and Description | +
---|---|
boolean |
+NbtBase.accept(NbtVisitor visitor)
+Accepts a NBT visitor.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt | ++ |
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Method and Description | +
---|---|
static <T> NbtWrapper<T> |
+NbtFactory.fromBase(NbtBase<T> base)
+Get a NBT wrapper from a NBT base.
+ |
+
static NbtWrapper<?> |
+NbtFactory.fromItemTag(org.bukkit.inventory.ItemStack stack)
+Construct a wrapper for an NBT tag stored (in memory) in an item stack.
+ |
+
static <T> NbtWrapper<T> |
+NbtFactory.fromNMS(java.lang.Object handle)
+Initialize a NBT wrapper.
+ |
+
static <T> NbtWrapper<T> |
+NbtFactory.ofWrapper(java.lang.Class<?> type,
+ java.lang.String name,
+ T value)
+Create a new NBT wrapper from a given type.
+ |
+
static <T> NbtWrapper<T> |
+NbtFactory.ofWrapper(NbtType type,
+ java.lang.String name)
+Create a new NBT wrapper from a given type.
+ |
+
static <T> NbtWrapper<T> |
+NbtFactory.ofWrapper(NbtType type,
+ java.lang.String name,
+ T value)
+Create a new NBT wrapper from a given type.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
<TType> NbtWrapper<TType> |
+NbtConfigurationSerializer.deserialize(org.bukkit.configuration.ConfigurationSection root,
+ java.lang.String nodeName)
+Read a NBT tag from a root configuration.
+ |
+
<TType> NbtWrapper<TType> |
+NbtBinarySerializer.deserialize(java.io.DataInput source)
+Load an NBT tag from a stream.
+ |
+
<TType> NbtWrapper<TType> |
+NbtTextSerializer.deserialize(java.lang.String input)
+Deserialize a NBT tag from a base-64 encoded string.
+ |
+
public class NbtBinarySerializer
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static NbtBinarySerializer |
+DEFAULT
+Retrieve a default instance of the NBT binary serializer.
+ |
+
Constructor and Description | +
---|
NbtBinarySerializer() |
+
Modifier and Type | +Method and Description | +
---|---|
<TType> NbtWrapper<TType> |
+deserialize(java.io.DataInput source)
+Load an NBT tag from a stream.
+ |
+
NbtCompound |
+deserializeCompound(java.io.DataInput source)
+Load an NBT compound from a stream.
+ |
+
<T> NbtList<T> |
+deserializeList(java.io.DataInput source)
+Load an NBT list from a stream.
+ |
+
<TType> void |
+serialize(NbtBase<TType> value,
+ java.io.DataOutput destination)
+Write the content of a wrapped NBT tag to a stream.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final NbtBinarySerializer DEFAULT+
public <TType> void serialize(NbtBase<TType> value, + java.io.DataOutput destination)+
value
- - the NBT tag to write.destination
- - the destination stream.public <TType> NbtWrapper<TType> deserialize(java.io.DataInput source)+
source
- - the input stream.public NbtCompound deserializeCompound(java.io.DataInput source)+
source
- - the input stream.public <T> NbtList<T> deserializeList(java.io.DataInput source)+
source
- - the input stream.public class NbtConfigurationSerializer
+extends java.lang.Object
++ Note that data types may be internally preserved by modifying the serialized name. This may + be visible to the end-user.
Modifier and Type | +Field and Description | +
---|---|
static NbtConfigurationSerializer |
+DEFAULT
+A standard YAML serializer.
+ |
+
static java.lang.String |
+TYPE_DELIMITER
+The default delimiter that is used to store the data type in YAML.
+ |
+
Constructor and Description | +
---|
NbtConfigurationSerializer()
+Construct a serializer using
+TYPE_DELIMITER as the default delimiter. |
+
NbtConfigurationSerializer(java.lang.String dataTypeDelimiter)
+Construct a serializer using the given value as a delimiter.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
<TType> NbtWrapper<TType> |
+deserialize(org.bukkit.configuration.ConfigurationSection root,
+ java.lang.String nodeName)
+Read a NBT tag from a root configuration.
+ |
+
NbtCompound |
+deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root,
+ java.lang.String nodeName)
+Read a NBT compound from a root configuration.
+ |
+
<T> NbtList<T> |
+deserializeList(org.bukkit.configuration.file.YamlConfiguration root,
+ java.lang.String nodeName)
+Read a NBT compound from a root configuration.
+ |
+
java.lang.String |
+getDataTypeDelimiter()
+Retrieve the current data type delimiter.
+ |
+
<TType> void |
+serialize(NbtBase<TType> value,
+ org.bukkit.configuration.ConfigurationSection destination)
+Write the content of a NBT tag to a configuration section.
+ |
+
java.lang.Object |
+toNodeValue(java.lang.Object value,
+ NbtType type) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String TYPE_DELIMITER+
public static final NbtConfigurationSerializer DEFAULT+
public NbtConfigurationSerializer()+
TYPE_DELIMITER
as the default delimiter.public NbtConfigurationSerializer(java.lang.String dataTypeDelimiter)+
dataTypeDelimiter
- - the local data type delimiter.public java.lang.String getDataTypeDelimiter()+
public <TType> void serialize(NbtBase<TType> value, + org.bukkit.configuration.ConfigurationSection destination)+
value
- - the NBT tag to write.destination
- - the destination section.public <TType> NbtWrapper<TType> deserialize(org.bukkit.configuration.ConfigurationSection root, + java.lang.String nodeName)+
root
- - configuration that contains the NBT tag.nodeName
- - name of the NBT tag.public NbtCompound deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root, + java.lang.String nodeName)+
root
- - configuration that contains the NBT compound.nodeName
- - name of the NBT compound.public <T> NbtList<T> deserializeList(org.bukkit.configuration.file.YamlConfiguration root, + java.lang.String nodeName)+
root
- - configuration that contains the NBT compound.nodeName
- - name of the NBT compound.public java.lang.Object toNodeValue(java.lang.Object value, + NbtType type)+
public class NbtTextSerializer
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static NbtTextSerializer |
+DEFAULT
+A default instance of this serializer.
+ |
+
Constructor and Description | +
---|
NbtTextSerializer() |
+
NbtTextSerializer(NbtBinarySerializer binary)
+Construct a serializer with a custom binary serializer.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
<TType> NbtWrapper<TType> |
+deserialize(java.lang.String input)
+Deserialize a NBT tag from a base-64 encoded string.
+ |
+
NbtCompound |
+deserializeCompound(java.lang.String input)
+Deserialize a NBT compound from a base-64 encoded string.
+ |
+
<T> NbtList<T> |
+deserializeList(java.lang.String input)
+Deserialize a NBT list from a base-64 encoded string.
+ |
+
NbtBinarySerializer |
+getBinarySerializer()
+Retrieve the binary serializer that is used.
+ |
+
<TType> java.lang.String |
+serialize(NbtBase<TType> value)
+Serialize a NBT tag to a base-64 encoded string.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final NbtTextSerializer DEFAULT+
public NbtTextSerializer()+
public NbtTextSerializer(NbtBinarySerializer binary)+
binary
- - binary serializer.public NbtBinarySerializer getBinarySerializer()+
public <TType> java.lang.String serialize(NbtBase<TType> value)+
value
- - the NBT tag to serialize.public <TType> NbtWrapper<TType> deserialize(java.lang.String input) + throws java.io.IOException+
input
- - the base-64 string.java.io.IOException
- If we are unable to parse the input.public NbtCompound deserializeCompound(java.lang.String input) + throws java.io.IOException+
input
- - the base-64 string.java.io.IOException
- If we are unable to parse the input.public <T> NbtList<T> deserializeList(java.lang.String input) + throws java.io.IOException+
input
- - the base-64 string.java.io.IOException
- If we are unable to parse the input.Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Field and Description | +
---|---|
static NbtBinarySerializer |
+NbtBinarySerializer.DEFAULT
+Retrieve a default instance of the NBT binary serializer.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
NbtBinarySerializer |
+NbtTextSerializer.getBinarySerializer()
+Retrieve the binary serializer that is used.
+ |
+
Constructor and Description | +
---|
NbtTextSerializer(NbtBinarySerializer binary)
+Construct a serializer with a custom binary serializer.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Field and Description | +
---|---|
static NbtConfigurationSerializer |
+NbtConfigurationSerializer.DEFAULT
+A standard YAML serializer.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt.io | ++ |
Modifier and Type | +Field and Description | +
---|---|
static NbtTextSerializer |
+NbtTextSerializer.DEFAULT
+A default instance of this serializer.
+ |
+
Class | +Description | +
---|---|
NbtBinarySerializer | ++ |
NbtConfigurationSerializer | +
+ Serialize and deserialize NBT information from a configuration section.
+ |
+
NbtTextSerializer | +
+ Serializes NBT to a base-64 encoded string and back.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.wrappers.nbt.io | ++ |
Class and Description | +
---|
NbtBinarySerializer | +
NbtConfigurationSerializer
+ Serialize and deserialize NBT information from a configuration section.
+ |
+
NbtTextSerializer
+ Serializes NBT to a base-64 encoded string and back.
+ |
+
Interface | +Description | +
---|---|
NbtBase<TType> | +
+ Represents a generic container for an NBT element.
+ |
+
NbtCompound | +
+ Represents a mapping of arbitrary NBT elements and their unique names.
+ |
+
NbtList<TType> | +
+ Represents a list of NBT tags of the same type without names.
+ |
+
NbtVisitor | +
+ A visitor that can enumerate a NBT tree structure.
+ |
+
NbtWrapper<TType> | +
+ Indicates that this NBT wraps an underlying net.minecraft.server instance.
+ |
+
Class | +Description | +
---|---|
NbtFactory | +
+ Factory methods for creating NBT elements, lists and compounds.
+ |
+
Enum | +Description | +
---|---|
NbtType | +
+ Represents all the element types
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.wrappers | ++ |
com.comphenix.protocol.wrappers.nbt | ++ |
com.comphenix.protocol.wrappers.nbt.io | ++ |
Class and Description | +
---|
NbtBase
+ Represents a generic container for an NBT element.
+ |
+
Class and Description | +
---|
NbtBase
+ Represents a generic container for an NBT element.
+ |
+
Class and Description | +
---|
NbtBase
+ Represents a generic container for an NBT element.
+ |
+
NbtCompound
+ Represents a mapping of arbitrary NBT elements and their unique names.
+ |
+
NbtList
+ Represents a list of NBT tags of the same type without names.
+ |
+
NbtType
+ Represents all the element types
+ |
+
NbtVisitor
+ A visitor that can enumerate a NBT tree structure.
+ |
+
NbtWrapper
+ Indicates that this NBT wraps an underlying net.minecraft.server instance.
+ |
+
Class and Description | +
---|
NbtBase
+ Represents a generic container for an NBT element.
+ |
+
NbtCompound
+ Represents a mapping of arbitrary NBT elements and their unique names.
+ |
+
NbtList
+ Represents a list of NBT tags of the same type without names.
+ |
+
NbtType
+ Represents all the element types
+ |
+
NbtWrapper
+ Indicates that this NBT wraps an underlying net.minecraft.server instance.
+ |
+