| Modifier and Type | Field and Description |
|---|---|
static int |
ID |
| Constructor and Description |
|---|
CompoundTag()
Creates a tag.
|
CompoundTag(LinkedHashMap<String,Tag> value)
Creates a tag without wrapping the map.
|
CompoundTag(Map<String,Tag> value)
Creates a tag.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all tags from this compound tag.
|
CompoundTag |
clone() |
boolean |
contains(String tagName)
Checks whether the compound tag contains a tag.
|
Set<Map.Entry<String,Tag>> |
entrySet()
Gets the entry set of this compound tag.
|
boolean |
equals(Object o) |
<T extends Tag> |
get(String tagName)
Gets the tag.
|
int |
getTagId()
Returns the NBT tag id of this tag type, used in I/O.
|
Map<String,Tag> |
getValue()
Gets the value of this tag.
|
int |
hashCode() |
boolean |
isEmpty()
Checks whether the compound tag is empty.
|
Iterator<Map.Entry<String,Tag>> |
iterator() |
Set<String> |
keySet()
Gets a set of keys in this compound tag.
|
<T extends Tag> |
put(String tagName,
T tag)
Puts the tag into this compound tag.
|
void |
read(DataInput in)
Reads this tag from an input stream.
|
<T extends Tag> |
remove(String tagName)
Removes a tag from this compound tag.
|
void |
setValue(LinkedHashMap<String,Tag> value)
Sets the value of this tag without wrapping the map.
|
void |
setValue(Map<String,Tag> value)
Sets the value of this tag.
|
int |
size()
Gets the number of tags in this compound tag.
|
Collection<Tag> |
values()
Gets a collection of tags in this compound tag.
|
void |
write(DataOutput out)
Writes this tag to an output stream.
|
forEach, spliteratorpublic static final int ID
public CompoundTag()
public CompoundTag(Map<String,Tag> value)
value - The value of the tag.public CompoundTag(LinkedHashMap<String,Tag> value)
value - The value of the tag.public Map<String,Tag> getValue()
Tagpublic void setValue(Map<String,Tag> value)
value - New value of this tag.public void setValue(LinkedHashMap<String,Tag> value)
value - New value of this tag.public boolean isEmpty()
public boolean contains(String tagName)
tagName - Name of the tag to check for.@Nullable public <T extends Tag> T get(String tagName)
T - Type of tag to get.tagName - Name of the tag.@Nullable public <T extends Tag> T put(String tagName, T tag)
T - Type of tag to put.tagName - Name of the tag.tag - Tag to put into this compound tag.@Nullable public <T extends Tag> T remove(String tagName)
T - Type of tag to remove.tagName - Name of the tag to remove.public Set<String> keySet()
public Collection<Tag> values()
public Set<Map.Entry<String,Tag>> entrySet()
public int size()
public void clear()
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.public final CompoundTag clone()
Copyright © 2021. All rights reserved.