Package net.minecraft.util
Class WeightedList<U>
- java.lang.Object
-
- net.minecraft.util.WeightedList<U>
-
public class WeightedList<U> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WeightedList.Entry<T>
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<WeightedList.Entry<U>>
entries
private java.util.Random
random
-
Constructor Summary
Constructors Modifier Constructor Description WeightedList()
private
WeightedList(java.util.List<WeightedList.Entry<U>> p_i231541_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WeightedList<U>
add(U p_226313_1_, int p_226313_2_)
static <U> com.mojang.serialization.Codec<WeightedList<U>>
codec(com.mojang.serialization.Codec<U> p_234002_0_)
U
getOne(java.util.Random p_226318_1_)
boolean
isEmpty()
WeightedList<U>
shuffle()
WeightedList<U>
shuffle(java.util.Random p_226314_1_)
java.util.stream.Stream<U>
stream()
java.lang.String
toString()
-
-
-
Field Detail
-
entries
protected final java.util.List<WeightedList.Entry<U>> entries
-
random
private final java.util.Random random
-
-
Constructor Detail
-
WeightedList
public WeightedList()
-
WeightedList
private WeightedList(java.util.List<WeightedList.Entry<U>> p_i231541_1_)
-
-
Method Detail
-
codec
public static <U> com.mojang.serialization.Codec<WeightedList<U>> codec(com.mojang.serialization.Codec<U> p_234002_0_)
-
add
public WeightedList<U> add(U p_226313_1_, int p_226313_2_)
-
shuffle
public WeightedList<U> shuffle()
-
shuffle
public WeightedList<U> shuffle(java.util.Random p_226314_1_)
-
isEmpty
public boolean isEmpty()
-
stream
public java.util.stream.Stream<U> stream()
-
getOne
public U getOne(java.util.Random p_226318_1_)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-