Record Class ConstantFloat
java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.ConstantFloat
- All Implemented Interfaces:
FloatProvider, SampledFloat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MapCodec<ConstantFloat> private final floatThe field for thevaluerecord component.static final ConstantFloat -
Constructor Summary
ConstructorsConstructorDescriptionConstantFloat(float value) Creates an instance of aConstantFloatrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatmax()floatmin()static ConstantFloatof(float value) floatsample(RandomSource random) toString()Returns a string representation of this record class.floatvalue()Returns the value of thevaluerecord component.
-
Field Details
-
value
private final float valueThe field for thevaluerecord component. -
ZERO
-
MAP_CODEC
-
-
Constructor Details
-
ConstantFloat
public ConstantFloat(float value) Creates an instance of aConstantFloatrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
of
-
sample
- Specified by:
samplein interfaceSampledFloat
-
min
public float min()- Specified by:
minin interfaceFloatProvider
-
max
public float max()- Specified by:
maxin interfaceFloatProvider
-
codec
- Specified by:
codecin interfaceFloatProvider
-
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. -
value
public float value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-