public final class NBTUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Tag> |
getChildTag(Map<String,Tag> items,
String key,
Class<T> expected)
Get child tag of a NBT structure.
|
static Class<? extends Tag> |
getTypeClass(int type)
Gets the class of a type of tag.
|
static int |
getTypeCode(Class<? extends Tag> clazz)
Gets the type code of a tag class.
|
static String |
getTypeName(Class<? extends Tag> clazz)
Gets the type name of a tag.
|
static Vector |
toVector(ListTag listTag)
Read a vector from a list tag containing ideally three values: the
X, Y, and Z components.
|
public static String getTypeName(Class<? extends Tag> clazz)
clazz - the tag classpublic static int getTypeCode(Class<? extends Tag> clazz)
clazz - the tag classIllegalArgumentException - if the tag class is invalid.public static Class<? extends Tag> getTypeClass(int type)
type - the typeIllegalArgumentException - if the tag type is invalid.public static Vector toVector(ListTag listTag)
For values that are unavailable, their values will be 0.
listTag - the list tagpublic static <T extends Tag> T getChildTag(Map<String,Tag> items, String key, Class<T> expected) throws InvalidFormatException
items - the map to read fromkey - the key to look forexpected - the expected NBT class typeInvalidFormatExceptionCopyright © 2010-2014. All Rights Reserved.