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 intprivate final shortThe field for thevaluerecord 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_) voidaccept(TagVisitor p_178084_) box()bytecopy()doublefinal booleanIndicates whether some other object is "equal to" this one.floatbytegetId()getType()final inthashCode()Returns a hash code value for this object.intintValue()longshortinttoString()Returns a string representation of this record class.shortvalue()Returns the value of thevaluerecord component.static ShortTagvalueOf(short pData) voidwrite(DataOutput pOutput) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.nbt.NumericTag
asBoolean, asByte, asDouble, asFloat, asInt, asLong, asNumber, asShortMethods inherited from interface net.minecraft.nbt.Tag
acceptAsRoot, asByteArray, asCompound, asIntArray, asList, asLongArray, asString
-
Field Details
-
value
private final short valueThe field for thevaluerecord 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 aShortTagrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
valueOf
-
write
- Specified by:
writein interfaceTag- Throws:
IOException
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytesin interfaceTag
-
getId
public byte getId() -
getType
-
copy
- Specified by:
copyin interfacePrimitiveTag- Specified by:
copyin interfaceTag
-
accept
-
longValue
public long longValue()- Specified by:
longValuein interfaceNumericTag
-
intValue
public int intValue()- Specified by:
intValuein interfaceNumericTag
-
shortValue
public short shortValue()- Specified by:
shortValuein interfaceNumericTag
-
byteValue
public byte byteValue()- Specified by:
byteValuein interfaceNumericTag
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein interfaceNumericTag
-
floatValue
public float floatValue()- Specified by:
floatValuein interfaceNumericTag
-
box
- Specified by:
boxin 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 thevaluerecord component.- Returns:
- the value of the
valuerecord component
-