Record Class FloatTag

java.lang.Object
java.lang.Record
net.minecraft.nbt.FloatTag
All Implemented Interfaces:
NumericTag, PrimitiveTag, Tag

public record FloatTag(float value) extends Record implements NumericTag
  • Field Details

    • value

      private final float value
      The field for the value record component.
    • SELF_SIZE_IN_BYTES

      private static final int SELF_SIZE_IN_BYTES
      See Also:
    • ZERO

      public static final FloatTag ZERO
    • TYPE

      public static final TagType<FloatTag> TYPE
  • Constructor Details

    • FloatTag

      @Deprecated(forRemoval=true) public FloatTag(float value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of a FloatTag record class.
      Parameters:
      value - the value for the value record component
  • Method Details

    • valueOf

      public static FloatTag valueOf(float p_128567_)
    • write

      public void write(DataOutput p_128569_) throws IOException
      Specified by:
      write in interface Tag
      Throws:
      IOException
    • sizeInBytes

      public int sizeInBytes()
      Specified by:
      sizeInBytes in interface Tag
    • getId

      public byte getId()
      Specified by:
      getId in interface Tag
    • getType

      public TagType<FloatTag> getType()
      Specified by:
      getType in interface Tag
    • copy

      public FloatTag copy()
      Specified by:
      copy in interface PrimitiveTag
      Specified by:
      copy in interface Tag
    • accept

      public void accept(TagVisitor p_177866_)
      Specified by:
      accept in interface Tag
    • longValue

      public long longValue()
      Specified by:
      longValue in interface NumericTag
    • intValue

      public int intValue()
      Specified by:
      intValue in interface NumericTag
    • shortValue

      public short shortValue()
      Specified by:
      shortValue in interface NumericTag
    • byteValue

      public byte byteValue()
      Specified by:
      byteValue in interface NumericTag
    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in interface NumericTag
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in interface NumericTag
    • box

      public Number box()
      Specified by:
      box in interface NumericTag
    • accept

      Specified by:
      accept in interface Tag
    • toString

      public String 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:
      toString in interface Tag
      Specified by:
      toString in class Record
      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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • value

      public float value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component