Package dev.selena.luacore.utils.nbt
Class NBTUtils
java.lang.Object
dev.selena.luacore.utils.nbt.NBTUtils
NBT utility class mainly for serialization and storing custom nbt compounds
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
getEntityNBTContent
(Class<T> cls, String nameSpaceKey, de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT) Gets custom NBT datastatic <T> T
getEntityNBTContent
(Type type, String nameSpaceKey, de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT) Gets custom NBT datastatic <T> T
getNBTContent
(Class<T> cls, String nameSpaceKey, de.tr7zw.changeme.nbtapi.NBTCompound compoundTag) Gets custom NBT datastatic void
storeEntityNBTContent
(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT, Object content, String nameSpaceKey) Stores custom NBT content for entitystatic void
storeEntityNBTContent
(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT, Object content, String nameSpaceKey, Type type) Stores custom NBT content for entitystatic void
storeNBTContent
(de.tr7zw.changeme.nbtapi.NBTCompound compoundTag, Object content, String nameSpaceKey) Stores custom NBT content
-
Constructor Details
-
NBTUtils
public NBTUtils()
-
-
Method Details
-
storeNBTContent
public static void storeNBTContent(de.tr7zw.changeme.nbtapi.NBTCompound compoundTag, Object content, String nameSpaceKey) Stores custom NBT content- Parameters:
compoundTag
- The Compound tag you want to store in, usually use your plugins onecontent
- The value of the data you want to storenameSpaceKey
- where you should get the data from later- See Also:
-
storeEntityNBTContent
public static void storeEntityNBTContent(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT, Object content, String nameSpaceKey) Stores custom NBT content for entity- Parameters:
readWriteNBT
- The ReadWriteNBT tag you want to store in, usually use your plugins onecontent
- The value of the data you want to storenameSpaceKey
- where you should get the data from later- See Also:
-
storeEntityNBTContent
public static void storeEntityNBTContent(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT, Object content, String nameSpaceKey, Type type) Stores custom NBT content for entity- Parameters:
readWriteNBT
- The ReadWriteNBT tag you want to store in, usually use your plugins onecontent
- The value of the data you want to storenameSpaceKey
- where you should get the data from latertype
- The object type you want to populate- See Also:
-
getNBTContent
public static <T> T getNBTContent(Class<T> cls, String nameSpaceKey, de.tr7zw.changeme.nbtapi.NBTCompound compoundTag) Gets custom NBT data- Type Parameters:
T
- The class type- Parameters:
cls
- The class you want to map tonameSpaceKey
- The key you set instoreNBTContent(NBTCompound, Object, String)
compoundTag
- The NBTCompound you are storing the custom NBT in- Returns:
- Fully mapped class
-
getEntityNBTContent
public static <T> T getEntityNBTContent(Class<T> cls, String nameSpaceKey, de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT) Gets custom NBT data- Type Parameters:
T
- The class type- Parameters:
cls
- The class you want to map tonameSpaceKey
- The key you set instoreEntityNBTContent(ReadWriteNBT, Object, String)
readWriteNBT
- The NBTCompound you are storing the custom NBT in- Returns:
- Fully mapped class
-
getEntityNBTContent
public static <T> T getEntityNBTContent(Type type, String nameSpaceKey, de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT) Gets custom NBT data- Type Parameters:
T
- The class type- Parameters:
type
- The object type you want to map tonameSpaceKey
- The key you set instoreEntityNBTContent(ReadWriteNBT, Object, String, Type)
readWriteNBT
- The NBTCompound you are storing the custom NBT in- Returns:
- Fully mapped class
-