Package net.minestom.server.data
Class NbtDataImpl
java.lang.Object
net.minestom.server.data.DataImpl
net.minestom.server.data.NbtDataImpl
- All Implemented Interfaces:
Data
public class NbtDataImpl extends DataImpl
A data implementation backed by a
NBTCompound
.-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
KEY_PREFIX
-
Constructor Summary
Constructors Constructor Description NbtDataImpl()
-
Method Summary
Modifier and Type Method Description Data
copy()
Copies this data.void
writeToNbt(org.jglrxavpok.hephaistos.nbt.NBTCompound nbtCompound)
Writes all the data into aNBTCompound
.Methods inherited from class net.minestom.server.data.DataImpl
get, getKeys, getOrDefault, hasKey, isEmpty, set
-
Field Details
-
KEY_PREFIX
public static final java.lang.String KEY_PREFIX- See Also:
- Constant Field Values
-
-
Constructor Details
-
NbtDataImpl
public NbtDataImpl()
-
-
Method Details
-
copy
Description copied from interface:Data
Copies this data. -
writeToNbt
public void writeToNbt(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound nbtCompound)Writes all the data into aNBTCompound
.- Parameters:
nbtCompound
- the nbt compound to write to- Throws:
java.lang.NullPointerException
- if the type of a data is not a primitive nbt type and therefore not supported (you can useDataType.encode(BinaryWriter, Object)
to use byte array instead)
-