| Constructor and Description |
|---|
ListTag(String name)
Creates an empty list tag with the specified name and no defined type.
|
ListTag(String name,
Class<? extends Tag> type)
Creates an empty list tag with the specified name and type.
|
ListTag(String name,
List<Tag> value)
Creates a list tag with the specified name and value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Tag tag)
Adds a tag to this list tag.
|
ListTag |
clone() |
void |
destringify(SNBTIO.StringifiedNBTReader in)
Parses this tag from stringified NBT.
|
<T extends Tag> |
get(int index)
Gets the tag at the given index of this list tag.
|
Class<? extends Tag> |
getElementType()
Gets the element type of the ListTag.
|
List<Tag> |
getValue()
Gets the value of this tag.
|
Iterator<Tag> |
iterator() |
void |
read(DataInput in)
Reads this tag from an input stream.
|
boolean |
remove(Tag tag)
Removes a tag from this list tag.
|
void |
setValue(List<Tag> value)
Sets the value of this tag.
|
int |
size()
Gets the number of tags in this list tag.
|
void |
stringify(SNBTIO.StringifiedNBTWriter out,
boolean linebreak,
int depth)
Write this tag as stringified NBT.
|
void |
write(DataOutput out)
Writes this tag to an output stream.
|
equals, getName, toStringgetClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic ListTag(String name)
name - The name of the tag.public ListTag(String name, Class<? extends Tag> type)
name - The name of the tag.type - Tag type of the list.public ListTag(String name, List<Tag> value) throws IllegalArgumentException
name - The name of the tag.value - The value of the tag.IllegalArgumentException - If all tags in the list are not of the same type.public void setValue(List<Tag> value) throws IllegalArgumentException
value - New value of this tag.IllegalArgumentException - If all tags in the list are not of the same type.public Class<? extends Tag> getElementType()
public boolean add(Tag tag) throws IllegalArgumentException
tag - Tag to add. Should not be null.IllegalArgumentException - If the tag's type differs from the list tag's type.public boolean remove(Tag tag)
tag - Tag to remove.public <T extends Tag> T get(int index)
T - Type of tag to getindex - Index of the tag.public int size()
public void read(DataInput in) throws IOException
Tagread in class Tagin - Stream to read from.IOException - If an I/O error occurs.public void write(DataOutput out) throws IOException
Tagwrite in class Tagout - Stream to write to.IOException - If an I/O error occurs.public void destringify(SNBTIO.StringifiedNBTReader in) throws IOException
Tagdestringify in class Tagin - String to parse.IOExceptionpublic void stringify(SNBTIO.StringifiedNBTWriter out, boolean linebreak, int depth) throws IOException
Tagstringify in class TagIOExceptionCopyright © 2021. All rights reserved.