Class NBTUtils

java.lang.Object
dev.selena.luacore.utils.items.NBTUtils

public class NBTUtils extends Object
NBT utility class mainly for serialization and storing custom nbt compounds
  • 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 one
      content - The value of the data you want to store
      nameSpaceKey - where you should get the data from later
      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 to
      nameSpaceKey - The key you set in storeNBTContent(NBTCompound, Object, String)
      compoundTag - The NBTCompound you are storing the custom NBT in
      Returns:
      Fully mapped class