Record Class ClampedNormalFloat
java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.ClampedNormalFloat
- All Implemented Interfaces:
FloatProvider, SampledFloat
public record ClampedNormalFloat(float mean, float deviation, float min, float max)
extends Record
implements FloatProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for thedeviationrecord component.static final MapCodec<ClampedNormalFloat> private final floatThe field for themaxrecord component.private final floatThe field for themeanrecord component.private final floatThe field for theminrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionClampedNormalFloat(float mean, float deviation, float min, float max) Creates an instance of aClampedNormalFloatrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()floatReturns the value of thedeviationrecord component.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.floatmean()Returns the value of themeanrecord component.floatmin()Returns the value of theminrecord component.static ClampedNormalFloatof(float mean, float deviation, float min, float max) floatsample(RandomSource random) static floatsample(RandomSource random, float mean, float deviation, float min, float max) toString()Returns a string representation of this record class.
-
Field Details
-
mean
private final float meanThe field for themeanrecord component. -
deviation
private final float deviationThe field for thedeviationrecord component. -
min
private final float minThe field for theminrecord component. -
max
private final float maxThe field for themaxrecord component. -
MAP_CODEC
-
-
Constructor Details
-
ClampedNormalFloat
public ClampedNormalFloat(float mean, float deviation, float min, float max) Creates an instance of aClampedNormalFloatrecord class.- Parameters:
mean- the value for themeanrecord componentdeviation- the value for thedeviationrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
of
-
sample
- Specified by:
samplein interfaceSampledFloat
-
sample
-
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. -
mean
public float mean()Returns the value of themeanrecord component.- Returns:
- the value of the
meanrecord component
-
deviation
public float deviation()Returns the value of thedeviationrecord component.- Returns:
- the value of the
deviationrecord component
-
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
-