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 p_427226_) 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 p_427366_) private floatscaledValueToSlider(float p_427373_) 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
The field for theinitialrecord component. -
step
The field for thesteprecord component. -
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 p_427226_) -
isOutOfRange
private boolean isOutOfRange(float p_427366_) -
initialScaledValue
private float initialScaledValue() -
initialSliderValue
public float initialSliderValue() -
scaledValueToSlider
private float scaledValueToSlider(float p_427373_) -
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. -
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. -
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 '=='. -
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
Returns the value of theinitialrecord component.- Returns:
- the value of the
initialrecord component
-
step
Returns the value of thesteprecord component.- Returns:
- the value of the
steprecord component
-