Package net.minecraft.nbt
Class AbstractNbtNumber
java.lang.Object
net.minecraft.nbt.AbstractNbtNumber
- All Implemented Interfaces:
NbtElement
public abstract class AbstractNbtNumber extends Object implements NbtElement
Represents an NBT number.
The type 99 can be used to
check for the existence of any numeric element in a NBT compound object.
-
Field Summary
Fields inherited from interface net.minecraft.nbt.NbtElement
AQUA, GOLD, GREEN, RED -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNbtNumber() -
Method Summary
Modifier and Type Method Description abstract bytebyteValue()Gets the value as an 8-bit integer.abstract doubledoubleValue()Gets the value as a 64-bit floating-point number.abstract floatfloatValue()Gets the value as a 32-bit floating-point number.abstract intintValue()Gets the value as a 32-bit integer.abstract longlongValue()Gets the value as a 64-bit integer.abstract NumbernumberValue()Gets the value as a generic number.abstract shortshortValue()Gets the value as a 16-bit integer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.nbt.NbtElement
asString, copy, getNbtType, getType, toString, toText, toText, write
-
Constructor Details
-
AbstractNbtNumber
protected AbstractNbtNumber()
-
-
Method Details
-
longValue
public abstract long longValue()Gets the value as a 64-bit integer.- Returns:
- the value as a long
-
intValue
public abstract int intValue()Gets the value as a 32-bit integer.- Returns:
- the value as an int
-
shortValue
public abstract short shortValue()Gets the value as a 16-bit integer.- Returns:
- the value as a short
-
byteValue
public abstract byte byteValue()Gets the value as an 8-bit integer.- Returns:
- the value as a byte
-
doubleValue
public abstract double doubleValue()Gets the value as a 64-bit floating-point number.- Returns:
- the value as a double
-
floatValue
public abstract float floatValue()Gets the value as a 32-bit floating-point number.- Returns:
- the value as a float
-
numberValue
Gets the value as a generic number.- Returns:
- the value as a
Number
-