Record Class OptionInstance.ClampingLazyMaxIntRange

java.lang.Object
java.lang.Record
net.minecraft.client.OptionInstance.ClampingLazyMaxIntRange
All Implemented Interfaces:
OptionInstance.CycleableValueSet<Integer>, OptionInstance.IntRangeBase, OptionInstance.SliderableOrCyclableValueSet<Integer>, OptionInstance.SliderableValueSet<Integer>, OptionInstance.ValueSet<Integer>
Enclosing class:
OptionInstance<T>

public static record OptionInstance.ClampingLazyMaxIntRange(int minInclusive, IntSupplier maxSupplier, int encodableMaxInclusive) extends Record implements OptionInstance.IntRangeBase, OptionInstance.SliderableOrCyclableValueSet<Integer>
  • Field Details

    • minInclusive

      private final int minInclusive
      The field for the minInclusive record component.
    • maxSupplier

      private final IntSupplier maxSupplier
      The field for the maxSupplier record component.
    • encodableMaxInclusive

      private final int encodableMaxInclusive
      The field for the encodableMaxInclusive record component.
  • Constructor Details

    • ClampingLazyMaxIntRange

      public ClampingLazyMaxIntRange(int minInclusive, IntSupplier maxSupplier, int encodableMaxInclusive)
      Creates an instance of a ClampingLazyMaxIntRange record class.
      Parameters:
      minInclusive - the value for the minInclusive record component
      maxSupplier - the value for the maxSupplier record component
      encodableMaxInclusive - the value for the encodableMaxInclusive record component
  • Method Details

    • validateValue

      public Optional<Integer> validateValue(Integer p_231590_)
      Specified by:
      validateValue in interface OptionInstance.ValueSet<Integer>
    • maxInclusive

      public int maxInclusive()
      Specified by:
      maxInclusive in interface OptionInstance.IntRangeBase
    • codec

      public com.mojang.serialization.Codec<Integer> codec()
      Specified by:
      codec in interface OptionInstance.ValueSet<Integer>
    • createCycleButton

      public boolean createCycleButton()
      Specified by:
      createCycleButton in interface OptionInstance.SliderableOrCyclableValueSet<Integer>
    • valueListSupplier

      public CycleButton.ValueListSupplier<Integer> valueListSupplier()
      Specified by:
      valueListSupplier in interface OptionInstance.CycleableValueSet<Integer>
    • minInclusive

      public int minInclusive()
      Returns the value of the minInclusive record component.
      Specified by:
      minInclusive in interface OptionInstance.IntRangeBase
      Returns:
      the value of the minInclusive record component
    • 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 '=='.
      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.
    • maxSupplier

      public IntSupplier maxSupplier()
      Returns the value of the maxSupplier record component.
      Returns:
      the value of the maxSupplier record component
    • encodableMaxInclusive

      public int encodableMaxInclusive()
      Returns the value of the encodableMaxInclusive record component.
      Returns:
      the value of the encodableMaxInclusive record component