Package net.minecraft.nbt
Class ListTag
- All Implemented Interfaces:
Iterable<Tag>,Collection<Tag>,List<Tag>,SequencedCollection<Tag>,CollectionTag,Tag
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCountFields inherited from interface net.minecraft.nbt.Tag
ARRAY_HEADER, MAX_DEPTH, OBJECT_HEADER, OBJECT_REFERENCE, STRING_SIZE, TAG_BYTE, TAG_BYTE_ARRAY, TAG_COMPOUND, TAG_DOUBLE, TAG_END, TAG_FLOAT, TAG_INT, TAG_INT_ARRAY, TAG_LIST, TAG_LONG, TAG_LONG_ARRAY, TAG_SHORT, TAG_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept(StreamTagVisitor p_197487_) voidaccept(TagVisitor p_177990_) voidvoidaddAndUnwrap(Tag tag) booleanasList()voidclear()copy()booleanget(int index) getCompound(int index) getCompoundOrEmpty(int index) getDouble(int index) doublegetDoubleOr(int index, double defaultValue) getFloat(int index) floatgetFloatOr(int index, float defaultValue) bytegetId()getInt(int index) Optional<int[]> getIntArray(int index) intgetIntOr(int index, int defaultValue) getList(int index) getListOrEmpty(int index) Optional<long[]> getLongArray(int index) private TaggetNullable(int index) getOptional(int index) getShort(int index) shortgetShortOr(int index, short defaultValue) getString(int index) getStringOr(int index, String defaultValue) getType()inthashCode()(package private) bytebooleanisEmpty()private static booleanisWrapper(CompoundTag tag) remove(int p_128751_) booleanintsize()intstream()toString()private static TagtryUnwrap(CompoundTag tag) private static CompoundTagwrapElement(Tag tag) private static TagwrapIfNeeded(byte elementType, Tag tag) voidwrite(DataOutput output) Methods inherited from class java.util.AbstractList
add, addAll, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, toArrayMethods inherited from interface net.minecraft.nbt.CollectionTag
iteratorMethods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArrayMethods inherited from interface net.minecraft.nbt.Tag
acceptAsRoot, asBoolean, asByte, asByteArray, asCompound, asDouble, asFloat, asInt, asIntArray, asLong, asLongArray, asNumber, asShort, asString
-
Field Details
-
WRAPPER_MARKER
- See Also:
-
SELF_SIZE_IN_BYTES
private static final int SELF_SIZE_IN_BYTES- See Also:
-
TYPE
-
list
-
-
Constructor Details
-
ListTag
public ListTag() -
ListTag
public ListTag(int initialCapacity) Neo: create a list tag with the given initial capacity.- Parameters:
initialCapacity- the initial capacity of the list tag
-
ListTag
-
-
Method Details
-
tryUnwrap
-
isWrapper
-
wrapIfNeeded
-
wrapElement
-
write
- Specified by:
writein interfaceTag- Throws:
IOException
-
identifyRawElementType
byte identifyRawElementType() -
addAndUnwrap
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytesin interfaceTag
-
getId
public byte getId() -
getType
-
toString
- Specified by:
toStringin interfaceTag- Overrides:
toStringin classAbstractCollection<Tag>
-
remove
- Specified by:
removein interfaceCollectionTag- Specified by:
removein interfaceList<Tag>- Overrides:
removein classAbstractList<Tag>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Tag>- Specified by:
isEmptyin interfaceCollectionTag- Specified by:
isEmptyin interfaceList<Tag>- Overrides:
isEmptyin classAbstractCollection<Tag>
-
getCompound
-
getCompoundOrEmpty
-
getList
-
getListOrEmpty
-
getShort
-
getShortOr
public short getShortOr(int index, short defaultValue) -
getInt
-
getIntOr
public int getIntOr(int index, int defaultValue) -
getIntArray
-
getLongArray
-
getDouble
-
getDoubleOr
public double getDoubleOr(int index, double defaultValue) -
getFloat
-
getFloatOr
public float getFloatOr(int index, float defaultValue) -
getString
-
getStringOr
-
getNullable
-
getOptional
-
size
public int size()- Specified by:
sizein interfaceCollection<Tag>- Specified by:
sizein interfaceCollectionTag- Specified by:
sizein interfaceList<Tag>- Specified by:
sizein classAbstractCollection<Tag>
-
get
- Specified by:
getin interfaceCollectionTag- Specified by:
getin interfaceList<Tag>- Specified by:
getin classAbstractList<Tag>
-
set
-
add
-
setTag
- Specified by:
setTagin interfaceCollectionTag
-
addTag
- Specified by:
addTagin interfaceCollectionTag
-
copy
-
asList
-
equals
- Specified by:
equalsin interfaceCollection<Tag>- Specified by:
equalsin interfaceList<Tag>- Overrides:
equalsin classAbstractList<Tag>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Tag>- Specified by:
hashCodein interfaceList<Tag>- Overrides:
hashCodein classAbstractList<Tag>
-
stream
- Specified by:
streamin interfaceCollection<Tag>- Specified by:
streamin interfaceCollectionTag
-
compoundStream
-
accept
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Tag>- Specified by:
clearin interfaceCollectionTag- Specified by:
clearin interfaceList<Tag>- Overrides:
clearin classAbstractList<Tag>
-
accept
-