Class CompoundTag

java.lang.Object
com.sk89q.jnbt.Tag
com.sk89q.jnbt.CompoundTag
All Implemented Interfaces:
com.sk89q.worldedit.util.nbt.BinaryTagLike
Direct Known Subclasses:
CompressedCompoundTag, LazyCompoundTag

@Deprecated public class CompoundTag extends Tag
Deprecated.
Use CompoundBinaryTag.
The TAG_Compound tag.
  • Constructor Details

    • CompoundTag

      public CompoundTag(Map<String,Tag> value)
      Deprecated.
      Creates the tag with an empty name.
      Parameters:
      value - the value of the tag
    • CompoundTag

      public CompoundTag(com.sk89q.worldedit.util.nbt.CompoundBinaryTag adventureTag)
      Deprecated.
  • Method Details

    • containsKey

      public boolean containsKey(String key)
      Deprecated.
      Returns whether this compound tag contains the given key.
      Parameters:
      key - the given key
      Returns:
      true if the tag contains the given key
    • getValue

      public Map<String,Tag> getValue()
      Deprecated.
      Description copied from class: Tag
      Gets the value of this tag.
      Specified by:
      getValue in class Tag
      Returns:
      the value
    • setValue

      public CompoundTag setValue(Map<String,Tag> value)
      Deprecated.
      Return a new compound tag with the given values.
      Parameters:
      value - the value
      Returns:
      the new compound tag
    • createBuilder

      public CompoundTagBuilder createBuilder()
      Deprecated.
      Create a compound tag builder.
      Returns:
      the builder
    • getByteArray

      public byte[] getByteArray(String key)
      Deprecated.
      Get a byte array named with the given key.

      If the key does not exist or its value is not a byte array tag, then an empty byte array will be returned.

      Parameters:
      key - the key
      Returns:
      a byte array
    • getByte

      public byte getByte(String key)
      Deprecated.
      Get a byte named with the given key.

      If the key does not exist or its value is not a byte tag, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      a byte
    • getDouble

      public double getDouble(String key)
      Deprecated.
      Get a double named with the given key.

      If the key does not exist or its value is not a double tag, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      a double
    • asDouble

      public double asDouble(String key)
      Deprecated.
      Get a double named with the given key, even if it's another type of number.

      If the key does not exist or its value is not a number, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      a double
    • getFloat

      public float getFloat(String key)
      Deprecated.
      Get a float named with the given key.

      If the key does not exist or its value is not a float tag, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      a float
    • getIntArray

      public int[] getIntArray(String key)
      Deprecated.
      Get a int[] named with the given key.

      If the key does not exist or its value is not an int array tag, then an empty array will be returned.

      Parameters:
      key - the key
      Returns:
      an int array
    • getInt

      public int getInt(String key)
      Deprecated.
      Get an int named with the given key.

      If the key does not exist or its value is not an int tag, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      an int
    • asInt

      public int asInt(String key)
      Deprecated.
      Get an int named with the given key, even if it's another type of number.

      If the key does not exist or its value is not a number, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      an int
    • getList

      public List<Tag> getList(String key)
      Deprecated.
      Get a list of tags named with the given key.

      If the key does not exist or its value is not a list tag, then an empty list will be returned.

      Parameters:
      key - the key
      Returns:
      a list of tags
    • getListTag

      public ListTag getListTag(String key)
      Deprecated.
      Get a TagList named with the given key.

      If the key does not exist or its value is not a list tag, then an empty tag list will be returned.

      Parameters:
      key - the key
      Returns:
      a tag list instance
    • getList

      public <T extends Tag> List<T> getList(String key, Class<T> listType)
      Deprecated.
      Get a list of tags named with the given key.

      If the key does not exist or its value is not a list tag, then an empty list will be returned. If the given key references a list but the list of of a different type, then an empty list will also be returned.

      Type Parameters:
      T - the type of list
      Parameters:
      key - the key
      listType - the class of the contained type
      Returns:
      a list of tags
    • getLongArray

      public long[] getLongArray(String key)
      Deprecated.
      Get a long[] named with the given key.

      If the key does not exist or its value is not an long array tag, then an empty array will be returned.

      Parameters:
      key - the key
      Returns:
      an int array
    • getLong

      public long getLong(String key)
      Deprecated.
      Get a long named with the given key.

      If the key does not exist or its value is not a long tag, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      a long
    • asLong

      public long asLong(String key)
      Deprecated.
      Get a long named with the given key, even if it's another type of number.

      If the key does not exist or its value is not a number, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      a long
    • getShort

      public short getShort(String key)
      Deprecated.
      Get a short named with the given key.

      If the key does not exist or its value is not a short tag, then 0 will be returned.

      Parameters:
      key - the key
      Returns:
      a short
    • getString

      public String getString(String key)
      Deprecated.
      Get a string named with the given key.

      If the key does not exist or its value is not a string tag, then "" will be returned.

      Parameters:
      key - the key
      Returns:
      a string
    • asBinaryTag

      public com.sk89q.worldedit.util.nbt.CompoundBinaryTag asBinaryTag()
      Deprecated.
    • getUUID

      public UUID getUUID()
      Deprecated.
    • getEntityPosition

      public Vector3 getEntityPosition()
      Deprecated.
    • getEntityLocation

      public Location getEntityLocation(Extent extent)
      Deprecated.
    • getTypeCode

      public int getTypeCode()
      Deprecated.
      Specified by:
      getTypeCode in class Tag
    • toRaw

      public Map<String,Object> toRaw()
      Deprecated.
      Overrides:
      toRaw in class Tag