Record Class SkyLayerDefinition.Rotation

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.sky.SkyLayerDefinition.Rotation
Record Components:
axis - the axis, in world space; [0, 1, 0] spins around the zenith, [0, 0, 1] follows the path of vanilla's sun
speed - degrees per unit of the clock (per second, per day, or per degree of vanilla's angle)
Enclosing class:
SkyLayerDefinition

public static record SkyLayerDefinition.Rotation(org.joml.Vector3fc axis, float speed, SkyClock clock) extends Record
Turns the layer around an axis as its clock moves.
  • Field Details

  • Constructor Details

    • Rotation

      public Rotation(org.joml.Vector3fc axis, float speed, SkyClock clock)
      Creates an instance of a Rotation record class.
      Parameters:
      axis - the value for the axis record component
      speed - the value for the speed record component
      clock - the value for the clock record component
  • Method Details

    • withSun

      public static SkyLayerDefinition.Rotation withSun()
      Follows vanilla's sun, rising in the east: for a sprite, or a sky that turns with the day.
    • withMoon

      public static SkyLayerDefinition.Rotation withMoon()
      Follows vanilla's moon.
    • withStars

      public static SkyLayerDefinition.Rotation withStars()
      Follows vanilla's stars.
    • toString

      public final 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
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • axis

      public org.joml.Vector3fc axis()
      Returns the value of the axis record component.
      Returns:
      the value of the axis record component
    • speed

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

      public SkyClock clock()
      Returns the value of the clock record component.
      Returns:
      the value of the clock record component