Package net.minecraft.util.random
Class SimpleWeightedRandomList<E>
java.lang.Object
net.minecraft.util.random.WeightedRandomList<WeightedEntry.Wrapper<E>>
net.minecraft.util.random.SimpleWeightedRandomList<E>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> SimpleWeightedRandomList.Builder<E> builder()static <E> SimpleWeightedRandomList<E> empty()getRandomValue(RandomSource random) static <E> SimpleWeightedRandomList<E> single(E data) static <E> com.mojang.serialization.Codec<SimpleWeightedRandomList<E>> wrappedCodec(com.mojang.serialization.Codec<E> elementCodec) static <E> com.mojang.serialization.Codec<SimpleWeightedRandomList<E>> wrappedCodecAllowingEmpty(com.mojang.serialization.Codec<E> codec)
-
Constructor Details
-
SimpleWeightedRandomList
SimpleWeightedRandomList(List<? extends WeightedEntry.Wrapper<E>> items)
-
-
Method Details
-
wrappedCodecAllowingEmpty
public static <E> com.mojang.serialization.Codec<SimpleWeightedRandomList<E>> wrappedCodecAllowingEmpty(com.mojang.serialization.Codec<E> codec) -
wrappedCodec
public static <E> com.mojang.serialization.Codec<SimpleWeightedRandomList<E>> wrappedCodec(com.mojang.serialization.Codec<E> elementCodec) -
builder
-
empty
-
single
-
getRandomValue
-