Package com.fastasyncworldedit.core.util
Class NbtUtils
java.lang.Object
com.fastasyncworldedit.core.util.NbtUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends com.sk89q.worldedit.util.nbt.BinaryTag>
TgetChildTag
(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag, String key, com.sk89q.worldedit.util.nbt.BinaryTagType<T> expected) Get child tag of a NBT structure.getCompoundBinaryTagValues
(com.sk89q.worldedit.util.nbt.CompoundBinaryTag tag) Get a mutable map of the values stored inside aCompoundBinaryTag
static int
Get an integer from a tag.
-
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 fromkey
- the key to look forexpected
- 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 fromkey
- 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 aCompoundBinaryTag
- Parameters:
tag
-CompoundBinaryTag
to get values for- Returns:
- Mutable map of values
- Since:
- 2.1.0
-