Record Class UniformFloat
java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.UniformFloat
- All Implemented Interfaces:
FloatProvider, SampledFloat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MapCodec<UniformFloat> private final floatThe field for themaxrecord component.private final floatThe field for theminrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionUniformFloat(float min, float max) Creates an instance of aUniformFloatrecord 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()Returns the value of themaxrecord component.floatmin()Returns the value of theminrecord component.static UniformFloatof(float min, float max) floatsample(RandomSource random) toString()Returns a string representation of this record class.
-
Field Details
-
min
private final float minThe field for theminrecord component. -
max
private final float maxThe field for themaxrecord component. -
MAP_CODEC
-
-
Constructor Details
-
UniformFloat
public UniformFloat(float min, float max) Creates an instance of aUniformFloatrecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
of
-
sample
- Specified by:
samplein interfaceSampledFloat
-
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. -
min
public float min()Returns the value of theminrecord component.- Specified by:
minin interfaceFloatProvider- Returns:
- the value of the
minrecord component
-
max
public float max()Returns the value of themaxrecord component.- Specified by:
maxin interfaceFloatProvider- Returns:
- the value of the
maxrecord component
-