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 pVisitor) voidaccept(TagVisitor pVisitor) voidvoidaddAndUnwrap(Tag pTag) booleanasList()voidclear()copy()booleanget(int pIndex) getCompound(int pIndex) getCompoundOrEmpty(int pIndex) getDouble(int pIndex) doublegetDoubleOr(int pIndex, double pDefaultValue) getFloat(int pIndex) floatgetFloatOr(int pIndex, float pDefaultValue) bytegetId()getInt(int pIndex) Optional<int[]> getIntArray(int pIndex) intgetIntOr(int pIndex, int pDefaultValue) getList(int pIndex) getListOrEmpty(int pIndex) Optional<long[]> getLongArray(int pIndex) private TaggetNullable(int pIndex) getOptional(int pIndex) getShort(int pIndex) shortgetShortOr(int pIndex, short pDefaultValue) getString(int pIndex) getStringOr(int pIndex, String pDefaultValue) getType()inthashCode()(package private) bytebooleanisEmpty()private static booleanisWrapper(CompoundTag pTag) remove(int pIndex) booleanintsize()intstream()toString()private static TagtryUnwrap(CompoundTag pTag) private static CompoundTagwrapElement(Tag pTag) private static TagwrapIfNeeded(byte pElementType, Tag pTag) voidwrite(DataOutput pOutput) 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 pIndex, short pDefaultValue) -
getInt
-
getIntOr
public int getIntOr(int pIndex, int pDefaultValue) -
getIntArray
-
getLongArray
-
getDouble
-
getDoubleOr
public double getDoubleOr(int pIndex, double pDefaultValue) -
getFloat
-
getFloatOr
public float getFloatOr(int pIndex, float pDefaultValue) -
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
-