Record Class ClampedNormalInt
java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.ClampedNormalInt
- All Implemented Interfaces:
IntProvider
public record ClampedNormalInt(float mean, float deviation, int minInclusive, int maxInclusive)
extends Record
implements IntProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for thedeviationrecord component.static final MapCodec<ClampedNormalInt> private final intThe field for themaxInclusiverecord component.private final floatThe field for themeanrecord component.private final intThe field for theminInclusiverecord component. -
Constructor Summary
ConstructorsConstructorDescriptionClampedNormalInt(float mean, float deviation, int minInclusive, int maxInclusive) Creates an instance of aClampedNormalIntrecord 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.intReturns the value of themaxInclusiverecord component.floatmean()Returns the value of themeanrecord component.intReturns the value of theminInclusiverecord component.static ClampedNormalIntof(float mean, float deviation, int minInclusive, int maxInclusive) intsample(RandomSource random) static intsample(RandomSource random, float mean, float deviation, float minInclusive, float maxInclusive) 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. -
minInclusive
private final int minInclusiveThe field for theminInclusiverecord component. -
maxInclusive
private final int maxInclusiveThe field for themaxInclusiverecord component. -
MAP_CODEC
-
-
Constructor Details
-
ClampedNormalInt
public ClampedNormalInt(float mean, float deviation, int minInclusive, int maxInclusive) Creates an instance of aClampedNormalIntrecord class.- Parameters:
mean- the value for themeanrecord componentdeviation- the value for thedeviationrecord componentminInclusive- the value for theminInclusiverecord componentmaxInclusive- the value for themaxInclusiverecord component
-
-
Method Details
-
of
-
sample
- Specified by:
samplein interfaceIntProvider
-
sample
public static int sample(RandomSource random, float mean, float deviation, float minInclusive, float maxInclusive) -
codec
- Specified by:
codecin interfaceIntProvider
-
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
-
minInclusive
public int minInclusive()Returns the value of theminInclusiverecord component.- Specified by:
minInclusivein interfaceIntProvider- Returns:
- the value of the
minInclusiverecord component
-
maxInclusive
public int maxInclusive()Returns the value of themaxInclusiverecord component.- Specified by:
maxInclusivein interfaceIntProvider- Returns:
- the value of the
maxInclusiverecord component
-