Package net.minecraft.util
Class WeighedRandom
java.lang.Object
net.minecraft.util.WeighedRandom
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends WeighedRandom.WeighedRandomItem>
Optional<T>getRandomItem(Random p_145035_, List<T> p_145036_)
static <T extends WeighedRandom.WeighedRandomItem>
Optional<T>getRandomItem(Random p_145038_, List<T> p_145039_, int p_145040_)
static int
getTotalWeight(List<? extends WeighedRandom.WeighedRandomItem> p_14471_)
static <T extends WeighedRandom.WeighedRandomItem>
Optional<T>getWeightedItem(List<T> p_145032_, int p_145033_)
-
Field Details
-
LOGGER
static final org.apache.logging.log4j.Logger LOGGER
-
-
Constructor Details
-
WeighedRandom
public WeighedRandom()
-
-
Method Details
-
getTotalWeight
-
getRandomItem
public static <T extends WeighedRandom.WeighedRandomItem> Optional<T> getRandomItem(Random p_145038_, List<T> p_145039_, int p_145040_) -
getWeightedItem
public static <T extends WeighedRandom.WeighedRandomItem> Optional<T> getWeightedItem(List<T> p_145032_, int p_145033_) -
getRandomItem
public static <T extends WeighedRandom.WeighedRandomItem> Optional<T> getRandomItem(Random p_145035_, List<T> p_145036_)
-