Record Class PositionedColor

java.lang.Object
java.lang.Record
dev.latvian.mods.klib.color.PositionedColor
All Implemented Interfaces:
Comparable<PositionedColor>

public record PositionedColor(float position, Color color, Easing easing) extends Record implements Comparable<PositionedColor>
  • Field Details

    • EMPTY_ARRAY

      public static final PositionedColor[] EMPTY_ARRAY
    • INVALID

      public static final PositionedColor INVALID
    • CODEC

      public static final com.mojang.serialization.Codec<PositionedColor> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,PositionedColor> STREAM_CODEC
  • Constructor Details

    • PositionedColor

      public PositionedColor(float position, Color color)
    • PositionedColor

      public PositionedColor(float position, Color color, Easing easing)
      Creates an instance of a PositionedColor record class.
      Parameters:
      position - the value for the position record component
      color - the value for the color record component
      easing - the value for the easing record component
  • Method Details

    • compareTo

      public int compareTo(@NotNull @NotNull PositionedColor other)
      Specified by:
      compareTo in interface Comparable<PositionedColor>
    • interpolate

      public Color interpolate(float delta, PositionedColor other)
    • equals

      public 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 '=='.
      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.
    • 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
    • position

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

      public Color color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • easing

      public Easing easing()
      Returns the value of the easing record component.
      Returns:
      the value of the easing record component