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
modCount
Fields 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) void
accept
(TagVisitor pVisitor) void
void
addAndUnwrap
(Tag pTag) boolean
asList()
void
clear()
copy()
boolean
get
(int pIndex) getCompound
(int pIndex) getCompoundOrEmpty
(int pIndex) getDouble
(int pIndex) double
getDoubleOr
(int pIndex, double pDefaultValue) getFloat
(int pIndex) float
getFloatOr
(int pIndex, float pDefaultValue) byte
getId()
getInt
(int pIndex) Optional
<int[]> getIntArray
(int pIndex) int
getIntOr
(int pIndex, int pDefaultValue) getList
(int pIndex) getListOrEmpty
(int pIndex) Optional
<long[]> getLongArray
(int pIndex) private Tag
getNullable
(int pIndex) getOptional
(int pIndex) getShort
(int pIndex) short
getShortOr
(int pIndex, short pDefaultValue) getString
(int pIndex) getStringOr
(int pIndex, String pDefaultValue) getType()
int
hashCode()
(package private) byte
boolean
isEmpty()
private static boolean
isWrapper
(CompoundTag pTag) remove
(int pIndex) boolean
int
size()
int
stream()
toString()
private static Tag
tryUnwrap
(CompoundTag pTag) private static CompoundTag
wrapElement
(Tag pTag) private static Tag
wrapIfNeeded
(byte pElementType, Tag pTag) void
write
(DataOutput pOutput) Methods inherited from class java.util.AbstractList
add, addAll, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, toArray
Methods inherited from interface net.minecraft.nbt.CollectionTag
iterator
Methods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
Methods 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:
write
in interfaceTag
- Throws:
IOException
-
identifyRawElementType
byte identifyRawElementType() -
addAndUnwrap
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytes
in interfaceTag
-
getId
public byte getId() -
getType
-
toString
- Specified by:
toString
in interfaceTag
- Overrides:
toString
in classAbstractCollection<Tag>
-
remove
- Specified by:
remove
in interfaceCollectionTag
- Specified by:
remove
in interfaceList<Tag>
- Overrides:
remove
in classAbstractList<Tag>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<Tag>
- Specified by:
isEmpty
in interfaceCollectionTag
- Specified by:
isEmpty
in interfaceList<Tag>
- Overrides:
isEmpty
in 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:
size
in interfaceCollection<Tag>
- Specified by:
size
in interfaceCollectionTag
- Specified by:
size
in interfaceList<Tag>
- Specified by:
size
in classAbstractCollection<Tag>
-
get
- Specified by:
get
in interfaceCollectionTag
- Specified by:
get
in interfaceList<Tag>
- Specified by:
get
in classAbstractList<Tag>
-
set
-
add
-
setTag
- Specified by:
setTag
in interfaceCollectionTag
-
addTag
- Specified by:
addTag
in interfaceCollectionTag
-
copy
-
asList
-
equals
- Specified by:
equals
in interfaceCollection<Tag>
- Specified by:
equals
in interfaceList<Tag>
- Overrides:
equals
in classAbstractList<Tag>
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<Tag>
- Specified by:
hashCode
in interfaceList<Tag>
- Overrides:
hashCode
in classAbstractList<Tag>
-
stream
- Specified by:
stream
in interfaceCollection<Tag>
- Specified by:
stream
in interfaceCollectionTag
-
compoundStream
-
accept
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Tag>
- Specified by:
clear
in interfaceCollectionTag
- Specified by:
clear
in interfaceList<Tag>
- Overrides:
clear
in classAbstractList<Tag>
-
accept
-