Record Class PaletteMapping

java.lang.Object
java.lang.Record
net.minecraft.client.resources.palette.PaletteMapping
All Implemented Interfaces:
it.unimi.dsi.fastutil.ints.IntUnaryOperator, Function<Integer,Integer>, IntUnaryOperator, UnaryOperator<Integer>

public record PaletteMapping(it.unimi.dsi.fastutil.ints.Int2IntMap palette) extends Record implements it.unimi.dsi.fastutil.ints.IntUnaryOperator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PaletteMapping
     
    private final it.unimi.dsi.fastutil.ints.Int2IntMap
    The field for the palette record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PaletteMapping(it.unimi.dsi.fastutil.ints.Int2IntMap palette)
    Creates an instance of a PaletteMapping record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    apply(int baseColor)
     
    create(Palette base, Palette target)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    it.unimi.dsi.fastutil.ints.Int2IntMap
    Returns the value of the palette record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Function

    andThen, compose

    Methods inherited from interface it.unimi.dsi.fastutil.ints.IntUnaryOperator

    apply, applyAsInt

    Methods inherited from interface IntUnaryOperator

    andThen, compose
  • Field Details

    • palette

      private final it.unimi.dsi.fastutil.ints.Int2IntMap palette
      The field for the palette record component.
    • NONE

      public static final PaletteMapping NONE
  • Constructor Details

    • PaletteMapping

      public PaletteMapping(it.unimi.dsi.fastutil.ints.Int2IntMap palette)
      Creates an instance of a PaletteMapping record class.
      Parameters:
      palette - the value for the palette record component
  • Method Details

    • create

      public static PaletteMapping create(Palette base, Palette target)
    • apply

      public int apply(int baseColor)
      Specified by:
      apply in interface it.unimi.dsi.fastutil.ints.IntUnaryOperator
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • palette

      public it.unimi.dsi.fastutil.ints.Int2IntMap palette()
      Returns the value of the palette record component.
      Returns:
      the value of the palette record component