Class NbtUtils

java.lang.Object
com.fastasyncworldedit.core.util.NbtUtils

public class NbtUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends com.sk89q.worldedit.util.nbt.BinaryTag>
    T
    getChildTag(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag, String key, com.sk89q.worldedit.util.nbt.BinaryTagType<T> expected)
    Get child tag of a NBT structure.
    static Map<String,com.sk89q.worldedit.util.nbt.BinaryTag>
    getCompoundBinaryTagValues(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag)
    Get a mutable map of the values stored inside a CompoundBinaryTag
    static int
    getInt(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag, String key)
    Get an integer from a tag.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NbtUtils

      public NbtUtils()
  • Method Details

    • getChildTag

      public static <T extends com.sk89q.worldedit.util.nbt.BinaryTag> T getChildTag(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag, String key, com.sk89q.worldedit.util.nbt.BinaryTagType<T> expected) throws InvalidFormatException
      Get child tag of a NBT structure.
      Parameters:
      tag - the tag 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
    • getInt

      public static int getInt(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag, String key) throws InvalidFormatException
      Get an integer from a tag.
      Parameters:
      tag - the tag to read from
      key - the key to look for
      Returns:
      child tag
      Throws:
      InvalidFormatException - if the format of the items is invalid
      Since:
      2.1.0
    • getCompoundBinaryTagValues

      public static Map<String,com.sk89q.worldedit.util.nbt.BinaryTag> getCompoundBinaryTagValues(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag)
      Get a mutable map of the values stored inside a CompoundBinaryTag
      Parameters:
      tag - CompoundBinaryTag to get values for
      Returns:
      Mutable map of values
      Since:
      2.1.0