Class CompoundTagBuilder

java.lang.Object
com.sk89q.jnbt.CompoundTagBuilder

public class CompoundTagBuilder extends Object
Helps create compound tags.
  • Method Details

    • put

      public CompoundTagBuilder put(String key, Tag value)
      Put the given key and tag into the compound tag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putByteArray

      public CompoundTagBuilder putByteArray(String key, byte[] value)
      Put the given key and value into the compound tag as a ByteArrayTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putByte

      public CompoundTagBuilder putByte(String key, byte value)
      Put the given key and value into the compound tag as a ByteTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putDouble

      public CompoundTagBuilder putDouble(String key, double value)
      Put the given key and value into the compound tag as a DoubleTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putFloat

      public CompoundTagBuilder putFloat(String key, float value)
      Put the given key and value into the compound tag as a FloatTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putIntArray

      public CompoundTagBuilder putIntArray(String key, int[] value)
      Put the given key and value into the compound tag as a IntArrayTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putInt

      public CompoundTagBuilder putInt(String key, int value)
      Put the given key and value into the compound tag as an IntTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putLongArray

      public CompoundTagBuilder putLongArray(String key, long[] value)
      Put the given key and value into the compound tag as a LongArrayTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putLong

      public CompoundTagBuilder putLong(String key, long value)
      Put the given key and value into the compound tag as a LongTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putShort

      public CompoundTagBuilder putShort(String key, short value)
      Put the given key and value into the compound tag as a ShortTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • putString

      public CompoundTagBuilder putString(String key, String value)
      Put the given key and value into the compound tag as a StringTag.
      Parameters:
      key - they key
      value - the value
      Returns:
      this object
    • remove

      public CompoundTagBuilder remove(String key)
      Remove the given key from the compound tag. Does nothing if the key doesn't exist.
      Parameters:
      key - the key
      Returns:
      this object
    • putAll

      public CompoundTagBuilder putAll(Map<String,? extends Tag> value)
      Put all the entries from the given map into this map.
      Parameters:
      value - the map of tags
      Returns:
      this object
    • build

      public CompoundTag build()
      Build an unnamed compound tag with this builder's entries.
      Returns:
      the new compound tag
    • create

      public static CompoundTagBuilder create()
      Create a new builder instance.
      Returns:
      a new builder