Class NBTUtils

java.lang.Object
com.sk89q.jnbt.NBTUtils

@Deprecated public final class NBTUtils extends Object
Deprecated.
JNBT is being removed for adventure-nbt in WorldEdit 8.
A class which contains NBT-related utility methods.
  • Method Details

    • getTypeName

      public static String getTypeName(Class<? extends Tag<?,?>> clazz)
      Deprecated.
      Gets the type name of a tag.
      Parameters:
      clazz - the tag class
      Returns:
      The type name.
    • getTypeCode

      public static int getTypeCode(Class<? extends Tag<?,?>> clazz)
      Deprecated.
      Gets the type code of a tag class.
      Parameters:
      clazz - the tag class
      Returns:
      The type code.
      Throws:
      IllegalArgumentException - if the tag class is invalid.
    • getTypeClass

      public static Class<? extends Tag<?,?>> getTypeClass(int type)
      Deprecated.
      Gets the class of a type of tag.
      Parameters:
      type - the type
      Returns:
      The class.
      Throws:
      IllegalArgumentException - if the tag type is invalid.
    • toVector

      public static Vector3 toVector(ListTag<?,?> listTag)
      Deprecated.
      Read a vector from a list tag containing ideally three values: the X, Y, and Z components.

      For values that are unavailable, their values will be 0.

      Parameters:
      listTag - the list tag
      Returns:
      a vector
    • getChildTag

      public static <T extends Tag<?, ?>> T getChildTag(Map<String,Tag<?,?>> items, String key, Class<T> expected) throws InvalidFormatException
      Deprecated.
      Get child tag of a NBT structure.
      Parameters:
      items - the map to read from
      key - the key to look for
      expected - the expected NBT class type
      Returns:
      child tag
      Throws:
      InvalidFormatException - if the format of the items is invalid
    • addUUIDToMap

      @Deprecated(forRemoval=true, since="2.11.2") public static void addUUIDToMap(Map<String,Tag<?,?>> map, UUID uuid)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a UUID to a map for use in a CompoundTag
      Parameters:
      map - Map to add uuid to
      uuid - UUID to add
      Since:
      2.4.0