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, net.minecraft.util.EasingType ease) 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
    • LIST_STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, List<PositionedColor>> LIST_STREAM_CODEC
    • LIST_CODEC

      public static final com.mojang.serialization.Codec<List<PositionedColor>> LIST_CODEC
  • Constructor Details

    • PositionedColor

      public PositionedColor(float position, Color color)
    • PositionedColor

      public PositionedColor(float position, Color color, net.minecraft.util.EasingType ease)
      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
      ease - the value for the ease record component
  • Method Details

    • fromSimpleList

      public static List<PositionedColor> fromSimpleList(List<Color> colors)
    • toSimpleList

      public static List<Color> toSimpleList(List<PositionedColor> colors)
    • isSimple

      public static boolean isSimple(List<PositionedColor> colors)
    • 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 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.
    • 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
    • ease

      public net.minecraft.util.EasingType ease()
      Returns the value of the ease record component.
      Returns:
      the value of the ease record component