Package com.idark.valoria.util
Class RandomUtil.EasyRandom
java.lang.Object
com.idark.valoria.util.RandomUtil.EasyRandom
- Enclosing class:
- RandomUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
net.minecraft.core.BlockPos
getRandomPositionWithinRange
(net.minecraft.core.BlockPos centerPos, int xRadius, int yRadius, int zRadius) net.minecraft.core.BlockPos
getRandomPositionWithinRange
(net.minecraft.core.BlockPos centerPos, int xRadius, int yRadius, int zRadius, boolean safeSurfacePlacement, net.minecraft.world.level.Level world) net.minecraft.core.BlockPos
getRandomPositionWithinRange
(net.minecraft.core.BlockPos centerPos, int xRadius, int yRadius, int zRadius, boolean safeSurfacePlacement, net.minecraft.world.level.Level world, Predicate<net.minecraft.world.level.block.state.BlockState> statePredicate, int tries) <T> T
getRandomSelection
(List<T> options) <T> T
getRandomSelection
(T... options) boolean
percentChance
(float percentChance) double
int
randomNumberBetween
(int min, int max) int
randomNumberUpTo
(int upperBound) double
randomScaledGaussianValue
(double scale) double
randomValueBetween
(double min, double max) double
randomValueUpTo
(double upperBound) float
randomValueUpTo
(float upperBound) source()
-
Constructor Details
-
EasyRandom
-
-
Method Details
-
source
-
fiftyFifty
public boolean fiftyFifty() -
percentChance
public boolean percentChance(float percentChance) -
randomNumberUpTo
public int randomNumberUpTo(int upperBound) -
randomValueUpTo
public float randomValueUpTo(float upperBound) -
randomValueUpTo
public double randomValueUpTo(double upperBound) -
randomGaussianValue
public double randomGaussianValue() -
randomScaledGaussianValue
public double randomScaledGaussianValue(double scale) -
randomNumberBetween
public int randomNumberBetween(int min, int max) -
randomValueBetween
public double randomValueBetween(double min, double max) -
getRandomSelection
public <T> T getRandomSelection(@Nonnull T... options) -
getRandomSelection
-
getRandomPositionWithinRange
public net.minecraft.core.BlockPos getRandomPositionWithinRange(net.minecraft.core.BlockPos centerPos, int xRadius, int yRadius, int zRadius) -
getRandomPositionWithinRange
public net.minecraft.core.BlockPos getRandomPositionWithinRange(net.minecraft.core.BlockPos centerPos, int xRadius, int yRadius, int zRadius, boolean safeSurfacePlacement, net.minecraft.world.level.Level world) -
getRandomPositionWithinRange
public net.minecraft.core.BlockPos getRandomPositionWithinRange(net.minecraft.core.BlockPos centerPos, int xRadius, int yRadius, int zRadius, boolean safeSurfacePlacement, net.minecraft.world.level.Level world, @Nullable Predicate<net.minecraft.world.level.block.state.BlockState> statePredicate, int tries)
-