Package commoble.looot

# Class RandomHelper

java.lang.Object
commoble.looot.RandomHelper

public class RandomHelper extends Object

## Constructor Summary

Constructors
Constructor
Description
`RandomHelper()`

## Method Summary

Modifier and Type
Method
Description
`static <T> T`
`chooseRandomThing(net.minecraft.util.RandomSource rand, T... things)`
`static <T> T`
`getRandomThingFrom(net.minecraft.util.RandomSource rand, List<T> things)`
`static <T> Optional<T>`
`getRandomThingFromMultipleLists(net.minecraft.util.RandomSource rand, List<? extends List<T>> lists)`
Returns a random thing from a list of lists of things, weighted appropriate as if it were a single list of things, returns empty optional if all lists are empty

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RandomHelper

public RandomHelper()

## Method Details

### getRandomThingFrom

@Nullable public static <T> T getRandomThingFrom(net.minecraft.util.RandomSource rand, List<T> things)

### chooseRandomThing

@SafeVarargs @Nullable public static <T> T chooseRandomThing(net.minecraft.util.RandomSource rand, T... things)

### getRandomThingFromMultipleLists

public static <T> Optional<T> getRandomThingFromMultipleLists(net.minecraft.util.RandomSource rand, List<? extends List<T>> lists)
Returns a random thing from a list of lists of things, weighted appropriate as if it were a single list of things, returns empty optional if all lists are empty

Parameters:
  `rand` -
  `lists` -
Returns: