Package net.minecraft.util.random
Class WeightedRandom
java.lang.Object
net.minecraft.util.random.WeightedRandom
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends WeightedEntry>
Optional<T>getRandomItem(Random p_146318_, List<T> p_146319_)
static <T extends WeightedEntry>
Optional<T>getRandomItem(Random p_146321_, List<T> p_146322_, int p_146323_)
static int
getTotalWeight(List<? extends WeightedEntry> p_146313_)
static <T extends WeightedEntry>
Optional<T>getWeightedItem(List<T> p_146315_, int p_146316_)
-
Constructor Details
-
WeightedRandom
private WeightedRandom()
-
-
Method Details
-
getTotalWeight
-
getRandomItem
public static <T extends WeightedEntry> Optional<T> getRandomItem(Random p_146321_, List<T> p_146322_, int p_146323_) -
getWeightedItem
public static <T extends WeightedEntry> Optional<T> getWeightedItem(List<T> p_146315_, int p_146316_) -
getRandomItem
public static <T extends WeightedEntry> Optional<T> getRandomItem(Random p_146318_, List<T> p_146319_)
-