Record Class NumberRangeInput.RangeInfo
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.NumberRangeInput.RangeInfo
- Enclosing class:
NumberRangeInput
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for theendrecord component.The field for theinitialrecord component.static final com.mojang.serialization.MapCodec<NumberRangeInput.RangeInfo> private final floatThe field for thestartrecord component.The field for thesteprecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatcomputeScaledValue(float sliderValue) floatend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.initial()Returns the value of theinitialrecord component.private floatfloatprivate booleanisOutOfRange(float scaledValue) private floatscaledValueToSlider(float value) floatstart()Returns the value of thestartrecord component.step()Returns the value of thesteprecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
start
private final float startThe field for thestartrecord component. -
end
private final float endThe field for theendrecord component. -
initial
-
step
-
MAP_CODEC
-
-
Constructor Details
-
RangeInfo
Creates an instance of aRangeInforecord class.- Parameters:
start- the value for thestartrecord componentend- the value for theendrecord componentinitial- the value for theinitialrecord componentstep- the value for thesteprecord component
-
-
Method Details
-
computeScaledValue
public float computeScaledValue(float sliderValue) -
isOutOfRange
private boolean isOutOfRange(float scaledValue) -
initialScaledValue
private float initialScaledValue() -
initialSliderValue
public float initialSliderValue() -
scaledValueToSlider
private float scaledValueToSlider(float value) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
start
public float start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
public float end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
initial
-
step
-