Package ch.njol.skript.util
Class SingleVariablePersistentDataType
java.lang.Object
ch.njol.skript.util.SingleVariablePersistentDataType
- All Implemented Interfaces:
org.bukkit.persistence.PersistentDataType<byte[],SerializedVariable.Value>
public final class SingleVariablePersistentDataType
extends Object
implements org.bukkit.persistence.PersistentDataType<byte[],SerializedVariable.Value>
This
PersistentDataType is used for single variables.
The NamespacedKey's key should be the variable's name.
{hello} -> "hello" and the SerializedVariable.Value is the variable's serialized value.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.persistence.PersistentDataType
org.bukkit.persistence.PersistentDataType.PrimitivePersistentDataType<T extends Object> -
Field Summary
Fields inherited from interface org.bukkit.persistence.PersistentDataType
BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER, TAG_CONTAINER_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromPrimitive(byte[] primitive, org.bukkit.persistence.PersistentDataAdapterContext context)Class<byte[]>byte[]toPrimitive(SerializedVariable.Value complex, org.bukkit.persistence.PersistentDataAdapterContext context)
-
Constructor Details
-
SingleVariablePersistentDataType
public SingleVariablePersistentDataType()
-
-
Method Details
-
getPrimitiveType
- Specified by:
getPrimitiveTypein interfaceorg.bukkit.persistence.PersistentDataType<byte[],SerializedVariable.Value>
-
getComplexType
- Specified by:
getComplexTypein interfaceorg.bukkit.persistence.PersistentDataType<byte[],SerializedVariable.Value>
-
toPrimitive
public byte[] toPrimitive(SerializedVariable.Value complex, org.bukkit.persistence.PersistentDataAdapterContext context)- Specified by:
toPrimitivein interfaceorg.bukkit.persistence.PersistentDataType<byte[],SerializedVariable.Value>
-
fromPrimitive
public SerializedVariable.Value fromPrimitive(byte[] primitive, org.bukkit.persistence.PersistentDataAdapterContext context)- Specified by:
fromPrimitivein interfaceorg.bukkit.persistence.PersistentDataType<byte[],SerializedVariable.Value>
-