Record Class OptionInstance.IntRange
java.lang.Object
java.lang.Record
net.minecraft.client.OptionInstance.IntRange
- All Implemented Interfaces:
OptionInstance.IntRangeBase, OptionInstance.SliderableValueSet<Integer>, OptionInstance.ValueSet<Integer>
- Enclosing class:
OptionInstance<T>
public static record OptionInstance.IntRange(int minInclusive, int maxInclusive, boolean applyValueImmediately)
extends Record
implements OptionInstance.IntRangeBase
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theapplyValueImmediatelyrecord component.private final intThe field for themaxInclusiverecord component.private final intThe field for theminInclusiverecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theapplyValueImmediatelyrecord component.com.mojang.serialization.Codec<Integer> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxInclusiverecord component.intReturns the value of theminInclusiverecord component.final StringtoString()Returns a string representation of this record class.validateValue(Integer value) Methods inherited from interface OptionInstance.IntRangeBase
fromSliderValue, next, previous, toSliderValue, xmapMethods inherited from interface OptionInstance.SliderableValueSet
createButton
-
Field Details
-
minInclusive
private final int minInclusiveThe field for theminInclusiverecord component. -
maxInclusive
private final int maxInclusiveThe field for themaxInclusiverecord component. -
applyValueImmediately
private final boolean applyValueImmediatelyThe field for theapplyValueImmediatelyrecord component.
-
-
Constructor Details
-
IntRange
public IntRange(int minInclusive, int maxInclusive) -
IntRange
public IntRange(int minInclusive, int maxInclusive, boolean applyValueImmediately) Creates an instance of aIntRangerecord class.- Parameters:
minInclusive- the value for theminInclusiverecord componentmaxInclusive- the value for themaxInclusiverecord componentapplyValueImmediately- the value for theapplyValueImmediatelyrecord component
-
-
Method Details
-
validateValue
- Specified by:
validateValuein interfaceOptionInstance.ValueSet<Integer>
-
codec
- Specified by:
codecin interfaceOptionInstance.ValueSet<Integer>
-
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
minInclusive
public int minInclusive()Returns the value of theminInclusiverecord component.- Specified by:
minInclusivein interfaceOptionInstance.IntRangeBase- Returns:
- the value of the
minInclusiverecord component
-
maxInclusive
public int maxInclusive()Returns the value of themaxInclusiverecord component.- Specified by:
maxInclusivein interfaceOptionInstance.IntRangeBase- Returns:
- the value of the
maxInclusiverecord component
-
applyValueImmediately
public boolean applyValueImmediately()Returns the value of theapplyValueImmediatelyrecord component.- Specified by:
applyValueImmediatelyin interfaceOptionInstance.SliderableValueSet<Integer>- Returns:
- the value of the
applyValueImmediatelyrecord component
-