Package net.minecraft.nbt
Record Class NbtShort
java.lang.Object
java.lang.Record
net.minecraft.nbt.NbtShort
- Record Components:
value-
- All Implemented Interfaces:
AbstractNbtNumber,NbtElement,NbtPrimitive
Represents an NBT 16-bit integer. Its type is 0x2.
Instances are immutable.
- Mappings:
Namespace Name named net/minecraft/nbt/NbtShortintermediary net/minecraft/class_2516official utnamed valueintermediary comp_3822official b
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final shortThe field for thevaluerecord component.Fields inherited from interface net.minecraft.nbt.NbtElement
BYTE_ARRAY_TYPE, BYTE_TYPE, COMPOUND_TYPE, DOUBLE_TYPE, END_TYPE, field_33246, field_33247, field_33248, field_33249, FLOAT_TYPE, INT_ARRAY_TYPE, INT_TYPE, LIST_TYPE, LONG_ARRAY_TYPE, LONG_TYPE, MAX_DEPTH, SHORT_TYPE, STRING_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionNbtShort(short value) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(NbtElementVisitor visitor) byteGets the value as an 8-bit integer.copy()Returns an NBT element of equal value that won't change with this element.doAccept(NbtScanner visitor) doubleGets the value as a 64-bit floating-point number.final booleanIndicates whether some other object is "equal to" this one.floatGets the value as a 32-bit floating-point number.Returns the NBT type definition of this NBT element.intbytegetType()Returns the type of this NBT element.final inthashCode()Returns a hash code value for this object.intintValue()Gets the value as a 32-bit integer.longGets the value as a 64-bit integer.Gets the value as a generic number.static NbtShortof(short value) Returns the NBT short fromvalue.shortGets the value as a 16-bit integer.toString()Returns a string representation of this record class.shortvalue()Returns the value of thevaluerecord component.voidwrite(DataOutput output) Writes the NBT element tooutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.nbt.AbstractNbtNumber
asBoolean, asByte, asDouble, asFloat, asInt, asLong, asNumber, asShortMethods inherited from interface net.minecraft.nbt.NbtElement
accept, asByteArray, asCompound, asIntArray, asLongArray, asNbtList, asString
-
Field Details
-
value
private final short valueThe field for thevaluerecord component. -
SIZE
private static final int SIZE- See Also:
- Mappings:
Namespace Name Mixin selector named SIZELnet/minecraft/nbt/NbtShort;SIZE:Iintermediary field_41728Lnet/minecraft/class_2516;field_41728:Iofficial cLut;c:I
-
TYPE
- Mappings:
Namespace Name Mixin selector named TYPELnet/minecraft/nbt/NbtShort;TYPE:Lnet/minecraft/nbt/NbtType;intermediary field_21043Lnet/minecraft/class_2516;field_21043:Lnet/minecraft/class_4614;official aLut;a:Lvc;
-
-
Constructor Details
-
NbtShort
Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance of aNbtShortrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
of
Returns the NBT short fromvalue.- Returns:
- the NBT short from
value - Mappings:
Namespace Name Mixin selector named ofLnet/minecraft/nbt/NbtShort;of(S)Lnet/minecraft/nbt/NbtShort;intermediary method_23254Lnet/minecraft/class_2516;method_23254(S)Lnet/minecraft/class_2516;official aLut;a(S)Lut;
-
write
Writes the NBT element tooutput.- Specified by:
writein interfaceNbtElement- Throws:
IOException- API Note:
- This is a low-level method for serializing NBT elements; consider using
NbtIo,NbtOps, orPacketByteBuf.writeNbt(net.minecraft.nbt.NbtElement)instead. - Mappings:
Namespace Name Mixin selector named writeLnet/minecraft/nbt/NbtElement;write(Ljava/io/DataOutput;)Vintermediary method_10713Lnet/minecraft/class_2520;method_10713(Ljava/io/DataOutput;)Vofficial aLva;a(Ljava/io/DataOutput;)V
-
getSizeInBytes
public int getSizeInBytes()- Specified by:
getSizeInBytesin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named getSizeInBytesLnet/minecraft/nbt/NbtElement;getSizeInBytes()Iintermediary method_47988Lnet/minecraft/class_2520;method_47988()Iofficial aLva;a()I
-
getType
public byte getType()Returns the type of this NBT element.- Specified by:
getTypein interfaceNbtElement- Returns:
- the type of this NBT element
- Mappings:
Namespace Name Mixin selector named getTypeLnet/minecraft/nbt/NbtElement;getType()Bintermediary method_10711Lnet/minecraft/class_2520;method_10711()Bofficial bLva;b()B
-
getNbtType
Returns the NBT type definition of this NBT element.- Specified by:
getNbtTypein interfaceNbtElement- Returns:
- the NBT type definition of this NBT element
- Mappings:
Namespace Name Mixin selector named getNbtTypeLnet/minecraft/nbt/NbtElement;getNbtType()Lnet/minecraft/nbt/NbtType;intermediary method_23258Lnet/minecraft/class_2520;method_23258()Lnet/minecraft/class_4614;official cLva;c()Lvc;
-
copy
Description copied from interface:NbtPrimitiveReturns an NBT element of equal value that won't change with this element.- Specified by:
copyin interfaceNbtElement- Specified by:
copyin interfaceNbtPrimitive- Returns:
- an NBT element of equal value that won't change with this element
- Mappings:
Namespace Name Mixin selector named copyLnet/minecraft/nbt/NbtShort;copy()Lnet/minecraft/nbt/NbtShort;intermediary method_10704Lnet/minecraft/class_2516;method_10704()Lnet/minecraft/class_2516;official eLut;e()Lut;
-
accept
- Specified by:
acceptin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named acceptLnet/minecraft/nbt/NbtElement;accept(Lnet/minecraft/nbt/visitor/NbtElementVisitor;)Vintermediary method_32289Lnet/minecraft/class_2520;method_32289(Lnet/minecraft/class_5627;)Vofficial aLva;a(Lve;)V
-
longValue
public long longValue()Gets the value as a 64-bit integer.- Specified by:
longValuein interfaceAbstractNbtNumber- Returns:
- the value as a long
- Mappings:
Namespace Name Mixin selector named longValueLnet/minecraft/nbt/AbstractNbtNumber;longValue()Jintermediary method_10699Lnet/minecraft/class_2514;method_10699()Jofficial gLuq;g()J
-
intValue
public int intValue()Gets the value as a 32-bit integer.- Specified by:
intValuein interfaceAbstractNbtNumber- Returns:
- the value as an int
- Mappings:
Namespace Name Mixin selector named intValueLnet/minecraft/nbt/AbstractNbtNumber;intValue()Iintermediary method_10701Lnet/minecraft/class_2514;method_10701()Iofficial hLuq;h()I
-
shortValue
public short shortValue()Gets the value as a 16-bit integer.- Specified by:
shortValuein interfaceAbstractNbtNumber- Returns:
- the value as a short
- Mappings:
Namespace Name Mixin selector named shortValueLnet/minecraft/nbt/AbstractNbtNumber;shortValue()Sintermediary method_10696Lnet/minecraft/class_2514;method_10696()Sofficial iLuq;i()S
-
byteValue
public byte byteValue()Gets the value as an 8-bit integer.- Specified by:
byteValuein interfaceAbstractNbtNumber- Returns:
- the value as a byte
- Mappings:
Namespace Name Mixin selector named byteValueLnet/minecraft/nbt/AbstractNbtNumber;byteValue()Bintermediary method_10698Lnet/minecraft/class_2514;method_10698()Bofficial jLuq;j()B
-
doubleValue
public double doubleValue()Gets the value as a 64-bit floating-point number.- Specified by:
doubleValuein interfaceAbstractNbtNumber- Returns:
- the value as a double
- Mappings:
Namespace Name Mixin selector named doubleValueLnet/minecraft/nbt/AbstractNbtNumber;doubleValue()Dintermediary method_10697Lnet/minecraft/class_2514;method_10697()Dofficial kLuq;k()D
-
floatValue
public float floatValue()Gets the value as a 32-bit floating-point number.- Specified by:
floatValuein interfaceAbstractNbtNumber- Returns:
- the value as a float
- Mappings:
Namespace Name Mixin selector named floatValueLnet/minecraft/nbt/AbstractNbtNumber;floatValue()Fintermediary method_10700Lnet/minecraft/class_2514;method_10700()Fofficial lLuq;l()F
-
numberValue
Gets the value as a generic number.- Specified by:
numberValuein interfaceAbstractNbtNumber- Returns:
- the value as a
Number - Mappings:
Namespace Name Mixin selector named numberValueLnet/minecraft/nbt/AbstractNbtNumber;numberValue()Ljava/lang/Number;intermediary method_10702Lnet/minecraft/class_2514;method_10702()Ljava/lang/Number;official mLuq;m()Ljava/lang/Number;
-
doAccept
- Specified by:
doAcceptin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named doAcceptLnet/minecraft/nbt/NbtElement;doAccept(Lnet/minecraft/nbt/scanner/NbtScanner;)Lnet/minecraft/nbt/scanner/NbtScanner$Result;intermediary method_39850Lnet/minecraft/class_2520;method_39850(Lnet/minecraft/class_6836;)Lnet/minecraft/class_6836$class_6838;official aLva;a(Lux;)Lux$b;
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.- Specified by:
toStringin interfaceNbtElement- Specified by:
toStringin classRecord- Returns:
- a string representation of this object
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
value
public short value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-