Package net.minecraft.nbt
Record Class ShortTag
java.lang.Object
java.lang.Record
net.minecraft.nbt.ShortTag
- All Implemented Interfaces:
NumericTag
,PrimitiveTag
,Tag
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private final short
The field for thevalue
record component.Fields inherited from interface net.minecraft.nbt.Tag
ARRAY_HEADER, MAX_DEPTH, OBJECT_HEADER, OBJECT_REFERENCE, STRING_SIZE, TAG_BYTE, TAG_BYTE_ARRAY, TAG_COMPOUND, TAG_DOUBLE, TAG_END, TAG_FLOAT, TAG_INT, TAG_INT_ARRAY, TAG_LIST, TAG_LONG, TAG_LONG_ARRAY, TAG_SHORT, TAG_STRING
-
Constructor Summary
ConstructorsConstructorDescriptionShortTag
(short value) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(StreamTagVisitor p_197515_) void
accept
(TagVisitor p_178084_) box()
byte
copy()
double
final boolean
Indicates whether some other object is "equal to" this one.float
byte
getId()
getType()
final int
hashCode()
Returns a hash code value for this object.int
intValue()
long
short
int
toString()
Returns a string representation of this record class.short
value()
Returns the value of thevalue
record component.static ShortTag
valueOf
(short p_129259_) void
write
(DataOutput p_129254_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.nbt.NumericTag
asBoolean, asByte, asDouble, asFloat, asInt, asLong, asNumber, asShort
Methods inherited from interface net.minecraft.nbt.Tag
acceptAsRoot, asByteArray, asCompound, asIntArray, asList, asLongArray, asString
-
Field Details
-
value
private final short valueThe field for thevalue
record component. -
SELF_SIZE_IN_BYTES
private static final int SELF_SIZE_IN_BYTES- See Also:
-
TYPE
-
-
Constructor Details
-
ShortTag
Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance of aShortTag
record class.- Parameters:
value
- the value for thevalue
record component
-
-
Method Details
-
valueOf
-
write
- Specified by:
write
in interfaceTag
- Throws:
IOException
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytes
in interfaceTag
-
getId
public byte getId() -
getType
-
copy
- Specified by:
copy
in interfacePrimitiveTag
- Specified by:
copy
in interfaceTag
-
accept
-
longValue
public long longValue()- Specified by:
longValue
in interfaceNumericTag
-
intValue
public int intValue()- Specified by:
intValue
in interfaceNumericTag
-
shortValue
public short shortValue()- Specified by:
shortValue
in interfaceNumericTag
-
byteValue
public byte byteValue()- Specified by:
byteValue
in interfaceNumericTag
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in interfaceNumericTag
-
floatValue
public float floatValue()- Specified by:
floatValue
in interfaceNumericTag
-
box
- Specified by:
box
in interfaceNumericTag
-
accept
-
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. -
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 thevalue
record component.- Returns:
- the value of the
value
record component
-