Interface WeightedListInt
- All Superinterfaces:
Comparable<ValueProvider>, IntProvider, ValueProvider, Wrapper
A two-stage provider: an entry is picked from the
distribution()
proportionally to its weight, then that entry's provider is sampled.
The reported bounds aggregate the min/max across every entry.- Since:
- 3.0.0
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface IntProvider
IntProvider.IntProviderBuilder<T,S> -
Method Summary
Modifier and TypeMethodDescriptionstatic WeightedListInt.Builderbuilder()Creates a new builder.The weighted pool of providers to sample from.default intThe largest value this provider can yield.default intThe smallest value this provider can yield.static WeightedListIntof(WeightedList<IntProvider> distribution) Creates a new weighted list int provider.default WeightedListInt.BuilderCreates a new builder with the same weighted distribution as this provider.Methods inherited from interface IntProvider
clamp, max, minMethods inherited from interface ValueProvider
compareToMethods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
distribution
The weighted pool of providers to sample from.- Returns:
- the weighted distribution
- Since:
- 3.0.0
-
toBuilder
Creates a new builder with the same weighted distribution as this provider.- Returns:
- a new builder with the same values
- Since:
- 3.3.0
-
minInclusive
Description copied from interface:IntProviderThe smallest value this provider can yield.- Specified by:
minInclusivein interfaceIntProvider- Returns:
- the smallest value this provider can yield.
-
maxInclusive
Description copied from interface:IntProviderThe largest value this provider can yield.- Specified by:
maxInclusivein interfaceIntProvider- Returns:
- the largest value this provider can yield.
-
of
Creates a new weighted list int provider.- Parameters:
distribution- the weighted pool of providers, which must not be empty- Returns:
- the weighted list int provider
- Since:
- 3.0.0
-
builder
Creates a new builder.- Returns:
- a new builder
- Since:
- 3.0.0
-