| Modifier and Type | Field and Description |
|---|---|
static int |
ID |
| Constructor and Description |
|---|
ListTag()
Creates an empty list tag and no defined type.
|
ListTag(@Nullable Class<? extends Tag> type)
Creates an empty list tag and type.
|
ListTag(List<Tag> value)
Creates a list tag and value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Tag tag)
Adds a tag to this list tag.
|
ListTag |
clone() |
boolean |
equals(Object o) |
<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.
|
int |
getTagId()
Returns the NBT tag id of this tag type, used in I/O.
|
List<Tag> |
getValue()
Gets the value of this tag.
|
int |
hashCode() |
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 |
write(DataOutput out)
Writes this tag to an output stream.
|
forEach, spliteratorpublic static final int ID
public ListTag()
public ListTag(@Nullable
@Nullable Class<? extends Tag> type)
type - Tag type of the list.public ListTag(List<Tag> value) throws IllegalArgumentException
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 write to.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.Copyright © 2021. All rights reserved.