public final class NBTUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T extends Tag>
|
getChildTag(java.util.Map<java.lang.String,Tag> items,
java.lang.String key,
java.lang.Class<T> expected)
Get child tag of a NBT structure.
|
static java.lang.Class<? extends Tag> |
getTypeClass(int type)
Gets the class of a type of tag.
|
static int |
getTypeCode(java.lang.Class<?
extends Tag> clazz)
Gets the type code of a tag class.
|
static java.lang.String |
getTypeName(java.lang.Class<?
extends Tag> clazz)
Gets the type name of a tag.
|
public static java.lang.String getTypeName(java.lang.Class<? extends Tag> clazz)
clazz
- the tag classpublic static int getTypeCode(java.lang.Class<? extends Tag> clazz)
clazz
- the tag classjava.lang.IllegalArgumentException
- if the tag class is invalid.
public static java.lang.Class<? extends Tag> getTypeClass(int type)
type
- the typejava.lang.IllegalArgumentException
- if the tag type is invalid.
public static <T extends Tag> T getChildTag(java.util.Map<java.lang.String,Tag> items, java.lang.String key, java.lang.Class<T> expected) throws java.lang.IllegalArgumentException
items
- the map to read fromkey
- the key to look forexpected
- the expected NBT class typeInvalidFormatException
java.lang.IllegalArgumentException