Package com.viaversion.nbt.tag
Class IntArrayTag
java.lang.Object
com.viaversion.nbt.tag.IntArrayTag
- All Implemented Interfaces:
NumberArrayTag,Tag
A tag containing an integer array.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the raw string representation of the value of this tag.copy()Returns a copy of this tag.booleanintget(int index) Gets a value in this tag's array.intgetTagId()Returns the NBT tag id of this tag type, used in I/O.int[]getValue()Returns the value of this tag.inthashCode()intlength()Gets the length of this tag's array.static IntArrayTagread(DataInput in, TagLimiter tagLimiter) voidset(int index, int value) Sets a value in this tag's array.voidsetValue(int[] value) Sets the value of this tag.Creates a new list tag from this tag.toString()voidwrite(DataOutput out) Writes this tag to an output stream.
-
Field Details
-
ID
public static final int ID- See Also:
-
-
Constructor Details
-
IntArrayTag
public IntArrayTag()Creates a tag. -
IntArrayTag
public IntArrayTag(int[] value) Creates a tag.- Parameters:
value- The value of the tag.
-
-
Method Details
-
read
- Throws:
IOException
-
getValue
public int[] getValue()Description copied from interface:TagReturns the value of this tag. -
asRawString
Description copied from interface:TagReturns the raw string representation of the value of this tag. For SNBT, useSNBT.serialize(Tag).- Specified by:
asRawStringin interfaceTag- Returns:
- raw string representation of the value of this tag
-
setValue
public void setValue(int[] value) Sets the value of this tag.- Parameters:
value- New value of this tag.
-
get
public int get(int index) Gets a value in this tag's array.- Parameters:
index- Index of the value.- Returns:
- The value at the given index.
-
set
public void set(int index, int value) Sets a value in this tag's array.- Parameters:
index- Index of the value.value- Value to set.
-
length
public int length()Description copied from interface:NumberArrayTagGets the length of this tag's array.- Specified by:
lengthin interfaceNumberArrayTag- Returns:
- array length
-
toListTag
Description copied from interface:NumberArrayTagCreates a new list tag from this tag.- Specified by:
toListTagin interfaceNumberArrayTag- Returns:
- a new list tag
-
write
Description copied from interface:TagWrites this tag to an output stream.- Specified by:
writein interfaceTag- Parameters:
out- data output to write to- Throws:
IOException- if an I/O error occurs
-
equals
-
hashCode
public int hashCode() -
copy
Description copied from interface:TagReturns a copy of this tag.- Specified by:
copyin interfaceNumberArrayTag- Specified by:
copyin interfaceTag- Returns:
- a copy of this tag
-
getTagId
public int getTagId()Description copied from interface:TagReturns the NBT tag id of this tag type, used in I/O. -
toString
-