Record Class SimpleOption.ValidatingIntSliderCallbacks

java.lang.Object
java.lang.Record
net.minecraft.client.option.SimpleOption.ValidatingIntSliderCallbacks
Record Components:
minInclusive -
maxInclusive -
applyValueImmediately -
All Implemented Interfaces:
SimpleOption.Callbacks<Integer>, SimpleOption.IntSliderCallbacks, SimpleOption.SliderCallbacks<Integer>
Enclosing class:
SimpleOption<T>

@Environment(CLIENT) public static record SimpleOption.ValidatingIntSliderCallbacks(int minInclusive, int maxInclusive, boolean applyValueImmediately) extends Record implements SimpleOption.IntSliderCallbacks
A set of callbacks for a slider of integer values with a fixed minimum and maximum values.
See Also:
Mappings:
Namespace Name
named net/minecraft/client/option/SimpleOption$ValidatingIntSliderCallbacks
intermediary net/minecraft/class_7172$class_7174
official fmi$f
named minInclusive
intermediary comp_593
official a
named maxInclusive
intermediary comp_594
official b
named applyValueImmediately
intermediary comp_2661
official c
  • Field Details

    • minInclusive

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

      private final int maxInclusive
      The field for the maxInclusive record component.
    • applyValueImmediately

      private final boolean applyValueImmediately
      The field for the applyValueImmediately record component.
  • Constructor Details

    • ValidatingIntSliderCallbacks

      public ValidatingIntSliderCallbacks(int minInclusive, int maxInclusive)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/option/SimpleOption$ValidatingIntSliderCallbacks;<init>(II)V
      intermediary <init> Lnet/minecraft/class_7172$class_7174;<init>(II)V
      official <init> Lfmi$f;<init>(II)V
    • ValidatingIntSliderCallbacks

      public ValidatingIntSliderCallbacks(int int2, int int3, boolean bool)
  • Method Details

    • validate

      public Optional<Integer> validate(Integer integer)
      Description copied from interface: SimpleOption.Callbacks
      Returns the validated value.

      Returning Optional.empty() indicates the passed value is invalid and it should reset to the default value. This method can also coerce the invalid value into a valid one by clamping, etc.

      Specified by:
      validate in interface SimpleOption.Callbacks<Integer>
      Returns:
      the validated value
      Mappings:
      Namespace Name Mixin selector
      named validate Lnet/minecraft/client/option/SimpleOption$ValidatingIntSliderCallbacks;validate(Ljava/lang/Integer;)Ljava/util/Optional;
      intermediary method_41761 Lnet/minecraft/class_7172$class_7174;method_41761(Ljava/lang/Integer;)Ljava/util/Optional;
      official a Lfmi$f;a(Ljava/lang/Integer;)Ljava/util/Optional;
    • codec

      public com.mojang.serialization.Codec<Integer> codec()
      Specified by:
      codec in interface SimpleOption.Callbacks<Integer>
      Mappings:
      Namespace Name Mixin selector
      named codec Lnet/minecraft/client/option/SimpleOption$Callbacks;codec()Lcom/mojang/serialization/Codec;
      intermediary comp_675 Lnet/minecraft/class_7172$class_7178;comp_675()Lcom/mojang/serialization/Codec;
      official f Lfmi$n;f()Lcom/mojang/serialization/Codec;
    • 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 object)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • minInclusive

      public int minInclusive()
      Returns the value of the minInclusive record component.
      Specified by:
      minInclusive in interface SimpleOption.IntSliderCallbacks
      Returns:
      the value of the minInclusive record component
    • maxInclusive

      public int maxInclusive()
      Returns the value of the maxInclusive record component.
      Specified by:
      maxInclusive in interface SimpleOption.IntSliderCallbacks
      Returns:
      the value of the maxInclusive record component
    • applyValueImmediately

      public boolean applyValueImmediately()
      Returns the value of the applyValueImmediately record component.
      Specified by:
      applyValueImmediately in interface SimpleOption.SliderCallbacks<Integer>
      Returns:
      the value of the applyValueImmediately record component