| Constructor and Description |
|---|
ListTag()
Create an empty list tag.
|
ListTag(java.util.List<T> list)
Create a list tag from a
List. |
ListTag(NbtType type)
Create a list tag with the given type.
|
ListTag(NbtType type,
java.util.List<T> value)
Create a list tag from a type and a
List. |
| Modifier and Type | Method and Description |
|---|---|
ListTag<T> |
add(T tag)
Add a tag to the list.
|
boolean |
canAdd(INbtTag tag)
Check if the tag can be added to the list.
|
boolean |
canAdd(NbtType type)
Check if the type can be added to the list.
|
INbtTag |
copy() |
boolean |
equals(java.lang.Object o) |
T |
get(int index)
Get a tag from the list.
|
NbtType |
getNbtType() |
NbtType |
getType() |
java.util.List<T> |
getValue() |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
ListTag<T> |
remove(T tag)
Remove a tag from the list.
|
ListTag<T> |
set(int index,
T tag)
Set a tag in the list.
|
ListTag<T> |
setValue(java.util.List<T> value)
Set the list value.
|
int |
size() |
java.lang.String |
toString() |
boolean |
trim()
Trim the list by removing empty tags.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitasArrayTag, asByteArrayTag, asByteTag, asCompoundTag, asDoubleTag, asFloatTag, asIntArrayTag, asIntTag, asListTag, asLongArrayTag, asLongTag, asNumberTag, asShortTag, asStringTag, isArrayTag, isByteArrayTag, isByteTag, isCompoundTag, isDoubleTag, isFloatTag, isIntArrayTag, isIntTag, isListTag, isLongArrayTag, isLongTag, isNumberTag, isShortTag, isStringTagpublic ListTag()
public ListTag(NbtType type)
type - The typepublic ListTag(java.util.List<T> list)
List.list - The listjava.lang.IllegalArgumentException - If the list contains mixed types@Nullable public NbtType getType()
public java.util.List<T> getValue()
public ListTag<T> setValue(java.util.List<T> value)
value - The new valuepublic T get(int index)
index - The indexpublic ListTag<T> add(T tag)
tag - The tagjava.lang.IllegalArgumentException - If the tag is not of the same type as the listpublic ListTag<T> set(int index, T tag)
index - The indextag - The tagjava.lang.IndexOutOfBoundsException - If the index is out of boundsjava.lang.IllegalArgumentException - If the tag is not of the same type as the listpublic ListTag<T> remove(T tag)
tag - The tagjava.lang.IllegalArgumentException - If the tag is not of the same type as the listpublic boolean canAdd(INbtTag tag)
tag - The tagpublic boolean canAdd(NbtType type)
type - The typepublic boolean trim()
public int size()
public boolean isEmpty()
public NbtType getNbtType()
getNbtType in interface INbtTagpublic INbtTag copy()
public java.util.Iterator<T> iterator()
public boolean equals(java.lang.Object o)
public int hashCode()