Class ClampedNormalInt
java.lang.Object
net.minecraft.util.valueproviders.IntProvider
net.minecraft.util.valueproviders.ClampedNormalInt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<ClampedNormalInt> private final float
private final int
private final float
private final int
Fields inherited from class net.minecraft.util.valueproviders.IntProvider
NON_NEGATIVE_CODEC, POSITIVE_CODEC
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ClampedNormalInt
(float mean, float deviation, int minInclusive, int maxInclusive) -
Method Summary
Modifier and TypeMethodDescriptionint
int
getType()
static ClampedNormalInt
of
(float mean, float deviation, int minInclusive, int maxInclusive) int
sample
(RandomSource random) static int
sample
(RandomSource random, float mean, float deviation, float minInclusive, float maxInclusive) toString()
Methods inherited from class net.minecraft.util.valueproviders.IntProvider
codec, validateCodec
-
Field Details
-
CODEC
-
mean
private final float mean -
deviation
private final float deviation -
minInclusive
private final int minInclusive -
maxInclusive
private final int maxInclusive
-
-
Constructor Details
-
ClampedNormalInt
private ClampedNormalInt(float mean, float deviation, int minInclusive, int maxInclusive)
-
-
Method Details
-
of
-
sample
- Specified by:
sample
in classIntProvider
-
sample
public static int sample(RandomSource random, float mean, float deviation, float minInclusive, float maxInclusive) -
getMinValue
public int getMinValue()- Specified by:
getMinValue
in classIntProvider
-
getMaxValue
public int getMaxValue()- Specified by:
getMaxValue
in classIntProvider
-
getType
- Specified by:
getType
in classIntProvider
-
toString
-