Class RandomWeightedList<T>
java.lang.Object
com.github.retrooper.packetevents.util.RandomWeightedList<T>
- All Implemented Interfaces:
Iterable<RandomWeightedList.Entry<T>>
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionRandomWeightedList
(List<RandomWeightedList.Entry<T>> entries) RandomWeightedList
(T entry, int weight) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> RandomWeightedList
<T> decode
(NBT nbt, ClientVersion version, ComponentType.Decoder<T> decoder) static <T> NBT
encode
(RandomWeightedList<T> list, ClientVersion version, ComponentType.Encoder<T> encoder) @NotNull Iterator
<RandomWeightedList.Entry<T>> iterator()
void
setEntries
(List<RandomWeightedList.Entry<T>> entries) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RandomWeightedList
public RandomWeightedList() -
RandomWeightedList
-
RandomWeightedList
-
RandomWeightedList
-
-
Method Details
-
decode
public static <T> RandomWeightedList<T> decode(NBT nbt, ClientVersion version, ComponentType.Decoder<T> decoder) -
encode
public static <T> NBT encode(RandomWeightedList<T> list, ClientVersion version, ComponentType.Encoder<T> encoder) -
getEntries
-
setEntries
-
iterator
-