Package net.minecraft.nbt
Class NbtByte
java.lang.Object
net.minecraft.nbt.AbstractNbtNumber
net.minecraft.nbt.NbtByte
- All Implemented Interfaces:
NbtElement
public class NbtByte extends AbstractNbtNumber
Represents an NBT byte.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classNbtByte.Cache -
Field Summary
Fields Modifier and Type Field Description static NbtByteONEstatic NbtType<NbtByte>TYPEprivate bytevaluestatic NbtByteZEROFields inherited from interface net.minecraft.nbt.NbtElement
AQUA, GOLD, GREEN, RED -
Constructor Summary
Constructors Modifier Constructor Description privateNbtByte(byte value) -
Method Summary
Modifier and Type Method Description bytebyteValue()Gets the value as an 8-bit integer.NbtBytecopy()Copies this NBT element.doubledoubleValue()Gets the value as a 64-bit floating-point number.booleanequals(Object o)floatfloatValue()Gets the value as a 32-bit floating-point number.NbtType<NbtByte>getNbtType()Gets the NBT type definition of this NBT element.bytegetType()Gets the type of this NBT element.inthashCode()intintValue()Gets the value as a 32-bit integer.longlongValue()Gets the value as a 64-bit integer.NumbernumberValue()Gets the value as a generic number.static NbtByteof(boolean value)static NbtByteof(byte value)shortshortValue()Gets the value as a 16-bit integer.StringtoString()TexttoText(String indent, int depth)voidwrite(DataOutput output)Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.nbt.NbtElement
asString, toText
-
Field Details
-
TYPE
-
ZERO
-
ONE
-
value
private final byte value
-
-
Constructor Details
-
NbtByte
private NbtByte(byte value)
-
-
Method Details
-
of
-
of
-
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 classObject
-
copy
Description copied from interface:NbtElementCopies this NBT element.- Returns:
- the copied element
-
equals
-
hashCode
public int hashCode() -
toText
-
longValue
public long longValue()Gets the value as a 64-bit integer.- Specified by:
longValuein classAbstractNbtNumber- Returns:
- the value as a long
-
intValue
public int intValue()Gets the value as a 32-bit integer.- Specified by:
intValuein classAbstractNbtNumber- Returns:
- the value as an int
-
shortValue
public short shortValue()Gets the value as a 16-bit integer.- Specified by:
shortValuein classAbstractNbtNumber- Returns:
- the value as a short
-
byteValue
public byte byteValue()Gets the value as an 8-bit integer.- Specified by:
byteValuein classAbstractNbtNumber- Returns:
- the value as a byte
-
doubleValue
public double doubleValue()Gets the value as a 64-bit floating-point number.- Specified by:
doubleValuein classAbstractNbtNumber- Returns:
- the value as a double
-
floatValue
public float floatValue()Gets the value as a 32-bit floating-point number.- Specified by:
floatValuein classAbstractNbtNumber- Returns:
- the value as a float
-
numberValue
Gets the value as a generic number.- Specified by:
numberValuein classAbstractNbtNumber- Returns:
- the value as a
Number
-