Class RandomUtil

java.lang.Object
com.idark.valoria.util.RandomUtil

public final class RandomUtil extends Object
  • Field Details

  • Constructor Details

    • RandomUtil

      public RandomUtil()
  • Method Details

    • fiftyFifty

      public static boolean fiftyFifty()
    • percentChance

      public static boolean percentChance(float percentChance)
      Parameters:
      percentChance - from 0.00f to 1
    • randomNumberUpTo

      public static int randomNumberUpTo(int upperBound)
    • randomValueUpTo

      public static float randomValueUpTo(float upperBound)
    • randomValueUpTo

      public static double randomValueUpTo(double upperBound)
    • randomGaussianValue

      public static double randomGaussianValue()
    • randomScaledGaussianValue

      public static double randomScaledGaussianValue(double scale)
    • randomNumberBetween

      public static int randomNumberBetween(int min, int max)
    • randomValueBetween

      public static double randomValueBetween(double min, double max)
    • getRandomSelection

      public static <T> T getRandomSelection(@Nonnull T... options)
    • getRandomSelection

      public static <T> T getRandomSelection(@Nonnull List<T> options)
    • getRandomPositionWithinRange

      public static net.minecraft.core.BlockPos getRandomPositionWithinRange(net.minecraft.core.BlockPos centerPos, int xRadius, int yRadius, int zRadius)
    • getRandomPositionWithinRange

      public static 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 static 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)