Package net.minecraft.util.collection
Class WeightedList<U>
java.lang.Object
net.minecraft.util.collection.WeightedList<U>
public class WeightedList<U> extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWeightedList.Entry<T> -
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description WeightedList()privateWeightedList(List<WeightedList.Entry<U>> entries) -
Method Summary
Modifier and Type Method Description WeightedList<U>add(U item, int weight)static <U> com.mojang.serialization.Codec<WeightedList<U>>createCodec(com.mojang.serialization.Codec<U> codec)booleanisEmpty()UpickRandom(Random random)WeightedList<U>shuffle()WeightedList<U>shuffle(Random random)Stream<U>stream()StringtoString()
-
Field Details
-
entries
-
random
-
-
Constructor Details
-
WeightedList
public WeightedList() -
WeightedList
-
-
Method Details
-
createCodec
public static <U> com.mojang.serialization.Codec<WeightedList<U>> createCodec(com.mojang.serialization.Codec<U> codec) -
add
-
shuffle
-
shuffle
-
isEmpty
public boolean isEmpty() -
stream
-
pickRandom
-
toString
-