Record Class Float3

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.Float3
Record Components:
x - x
y - y
z - z

@Internal public record Float3(float x, float y, float z) extends Record
A three float value (origin, rotation)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Float3
    Center
    static final com.google.gson.JsonDeserializer<Float3>
    Parser
    static final Float3
    Zero
  • Constructor Summary

    Constructors
    Constructor
    Description
    Float3(float value)
    Creates floats
    Float3(float x, float y, float z)
    Creates an instance of a Float3 record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Float3
    Converts zxy euler to xyz euler (Minecraft)
    @NotNull Float3
    div(float value)
    Divides floats.
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    @NotNull Float3
    Inverts XZ
    @NotNull Float3
    minus(@NotNull Float3 other)
    Subtracts other floats.
    @NotNull Float3
    plus(@NotNull Float3 other)
    Adds other floats.
    @NotNull Float3
    rotate(@NotNull org.joml.Quaternionf quaternionf)
    Rotates this float
    @NotNull Float3
    times(float value)
    Multiplies floats.
    @NotNull Float3
    Converts item model scale to block scale
    @NotNull com.google.gson.JsonArray
    Converts floats to JSON array.
    @NotNull String
    Returns a string representation of this record class.
    @NotNull org.joml.Vector3f
    Converts floats to vector.
    float
    x()
    Returns the value of the x record component.
    float
    y()
    Returns the value of the y record component.
    float
    z()
    Returns the value of the z record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CENTER

      public static final Float3 CENTER
      Center
    • ZERO

      public static final Float3 ZERO
      Zero
    • PARSER

      public static final com.google.gson.JsonDeserializer<Float3> PARSER
      Parser
  • Constructor Details

    • Float3

      public Float3(float value)
      Creates floats
      Parameters:
      value - scala
    • Float3

      public Float3(float x, float y, float z)
      Creates an instance of a Float3 record class.
      Parameters:
      x - the value for the x record component
      y - the value for the y record component
      z - the value for the z record component
  • Method Details

    • plus

      @NotNull public @NotNull Float3 plus(@NotNull @NotNull Float3 other)
      Adds other floats.
      Parameters:
      other - other floats
      Returns:
      new floats
    • convertToMinecraftDegree

      @NotNull public @NotNull Float3 convertToMinecraftDegree()
      Converts zxy euler to xyz euler (Minecraft)
      Returns:
      new float
    • rotate

      @NotNull public @NotNull Float3 rotate(@NotNull @NotNull org.joml.Quaternionf quaternionf)
      Rotates this float
      Parameters:
      quaternionf - rotation
      Returns:
      new float
    • minus

      @NotNull public @NotNull Float3 minus(@NotNull @NotNull Float3 other)
      Subtracts other floats.
      Parameters:
      other - other floats
      Returns:
      new floats
    • toBlockScale

      @NotNull public @NotNull Float3 toBlockScale()
      Converts item model scale to block scale
      Returns:
      block
    • times

      @NotNull public @NotNull Float3 times(float value)
      Multiplies floats.
      Parameters:
      value - multiplier
      Returns:
      new floats
    • div

      @NotNull public @NotNull Float3 div(float value)
      Divides floats.
      Parameters:
      value - multiplier
      Returns:
      new floats
    • invertXZ

      @NotNull public @NotNull Float3 invertXZ()
      Inverts XZ
      Returns:
      new floats
    • toJson

      @NotNull public @NotNull com.google.gson.JsonArray toJson()
      Converts floats to JSON array.
      Returns:
      json array
    • toVector

      @NotNull public @NotNull org.joml.Vector3f toVector()
      Converts floats to vector.
      Returns:
      vector
    • hashCode

      public 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 boolean equals(Object obj)
      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:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • toString

      @NotNull public @NotNull 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 class Record
      Returns:
      a string representation of this object
    • x

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

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

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