Package net.minecraft.nbt
Class NbtList
- All Implemented Interfaces:
Iterable<NbtElement>,Collection<NbtElement>,List<NbtElement>,NbtElement
public class NbtList extends AbstractNbtList<NbtElement>
-
Field Summary
Fields Modifier and Type Field Description private static ByteSetNBT_NUMBER_TYPESprivate bytetypestatic NbtType<NbtList>TYPEprivate List<NbtElement>valueFields inherited from class java.util.AbstractList
modCountFields inherited from interface net.minecraft.nbt.NbtElement
AQUA, GOLD, GREEN, RED -
Constructor Summary
Constructors Modifier Constructor Description NbtList()privateNbtList(List<NbtElement> list, byte type) -
Method Summary
Modifier and Type Method Description voidadd(int int2, NbtElement nbtElement)booleanaddElement(int index, NbtElement element)private booleancanAdd(NbtElement element)voidclear()NbtListcopy()Copies this NBT element.booleanequals(Object o)private voidforgetTypeIfEmpty()NbtElementget(int int2)NbtCompoundgetCompound(int index)doublegetDouble(int index)floatgetFloat(int index)bytegetHeldType()Gets the type of element that this list holds.intgetInt(int index)int[]getIntArray(int index)NbtListgetList(int index)NbtType<NbtList>getNbtType()Gets the NBT type definition of this NBT element.shortgetShort(int index)StringgetString(int index)bytegetType()Gets the type of this NBT element.inthashCode()booleanisEmpty()NbtElementremove(int int2)NbtElementset(int int2, NbtElement nbtElement)booleansetElement(int index, NbtElement element)intsize()StringtoString()TexttoText(String indent, int depth)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, stream, toArrayMethods inherited from interface java.util.List
addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayMethods inherited from interface net.minecraft.nbt.NbtElement
asString, toText
-
Field Details
-
TYPE
-
NBT_NUMBER_TYPES
-
value
-
type
private byte type
-
-
Constructor Details
-
NbtList
-
NbtList
public NbtList()
-
-
Method Details
-
write
- Throws:
IOException
-
getType
public byte getType()Gets the type of this NBT element.- Returns:
- the type
-
getNbtType
Gets the NBT type definition of this NBT element.- Returns:
- the element type definition
-
toString
- Specified by:
toStringin interfaceNbtElement- Overrides:
toStringin classAbstractCollection<NbtElement>
-
forgetTypeIfEmpty
private void forgetTypeIfEmpty() -
remove
- Specified by:
removein interfaceList<NbtElement>- Specified by:
removein classAbstractNbtList<NbtElement>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<NbtElement>- Specified by:
isEmptyin interfaceList<NbtElement>- Overrides:
isEmptyin classAbstractCollection<NbtElement>
-
getCompound
-
getList
-
getShort
public short getShort(int index) -
getInt
public int getInt(int index) -
getIntArray
public int[] getIntArray(int index) -
getDouble
public double getDouble(int index) -
getFloat
public float getFloat(int index) -
getString
-
size
public int size()- Specified by:
sizein interfaceCollection<NbtElement>- Specified by:
sizein interfaceList<NbtElement>- Specified by:
sizein classAbstractCollection<NbtElement>
-
get
- Specified by:
getin interfaceList<NbtElement>- Specified by:
getin classAbstractList<NbtElement>
-
set
- Specified by:
setin interfaceList<NbtElement>- Specified by:
setin classAbstractNbtList<NbtElement>
-
add
- Specified by:
addin interfaceList<NbtElement>- Specified by:
addin classAbstractNbtList<NbtElement>
-
setElement
- Specified by:
setElementin classAbstractNbtList<NbtElement>
-
addElement
- Specified by:
addElementin classAbstractNbtList<NbtElement>
-
canAdd
-
copy
Description copied from interface:NbtElementCopies this NBT element.- Returns:
- the copied element
-
equals
- Specified by:
equalsin interfaceCollection<NbtElement>- Specified by:
equalsin interfaceList<NbtElement>- Overrides:
equalsin classAbstractList<NbtElement>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<NbtElement>- Specified by:
hashCodein interfaceList<NbtElement>- Overrides:
hashCodein classAbstractList<NbtElement>
-
toText
-
getHeldType
public byte getHeldType()Gets the type of element that this list holds.- Specified by:
getHeldTypein classAbstractNbtList<NbtElement>- Returns:
- the type of element that this list holds
-
clear
public void clear()- Specified by:
clearin interfaceCollection<NbtElement>- Specified by:
clearin interfaceList<NbtElement>- Overrides:
clearin classAbstractList<NbtElement>
-