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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetEntityNBTContent(Class<T> cls, String nameSpaceKey, de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT) Gets custom NBT datastatic <T> TgetEntityNBTContent(Type type, String nameSpaceKey, de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT) Gets custom NBT datastatic <T> TgetNBTContent(Class<T> cls, String nameSpaceKey, de.tr7zw.changeme.nbtapi.NBTCompound compoundTag) Gets custom NBT datastatic voidstoreEntityNBTContent(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT, Object content, String nameSpaceKey) Stores custom NBT content for entitystatic <T> voidstoreEntityNBTContent(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT, T content, String nameSpaceKey, Type type) Stores custom NBT content for entitystatic voidstoreNBTContent(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT 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.iface.ReadWriteNBT 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 <T> void storeEntityNBTContent(de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT readWriteNBT, T 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(ReadWriteNBT, 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
-