Interface HeightProvider
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
BiasedToBottomHeight, ConstantHeight, TrapezoidHeight, UniformHeight, VeryBiasedToBottomHeight, WeightedListHeight
Wraps the HeightProvider family. Sampling occurs Minecraft code side,
so this wrapper only carries the anchors/shape parameters.
- Since:
- 2.3.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classHeightProvider.HeightProviderBuilder<T extends HeightProvider, S extends HeightProvider.HeightProviderBuilder<T,S>> Common abstract builder for height providers with inclusive anchor bounds. -
Method Summary
Modifier and TypeMethodDescriptionstatic BiasedToBottomHeight.BuilderCreates a new biased-to-bottom height builder.static BiasedToBottomHeightbiasedToBottom(VerticalAnchor minInclusive, VerticalAnchor maxInclusive, int inner) Weighted toward the bottom of the range.static ConstantHeightconstant(VerticalAnchor value) A single fixed anchor.static HeightProviderReads a Minecraft height provider into a wrapper.The vertical anchor used as the maximum height.The vertical anchor used as the minimum height.static TrapezoidHeight.BuilderCreates a new trapezoid height builder.static TrapezoidHeighttrapezoid(VerticalAnchor minInclusive, VerticalAnchor maxInclusive, int plateau) Trapezoidal distribution with a flat plateau of the given height.static UniformHeight.Builderuniform()Creates a new uniform height builder.static UniformHeightuniform(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) Uniformly distributed between two anchors (inclusive).Creates a new very biased-to-bottom height builder.static VeryBiasedToBottomHeightveryBiasedToBottom(VerticalAnchor minInclusive, VerticalAnchor maxInclusive, int inner) Weighted very strongly toward the bottom of the range.static WeightedListHeight.BuilderCreates a new weighted list height builder.static WeightedListHeightweightedList(WeightedList<HeightProvider> distribution) A random value drawn from a weighted list of height providers.static ConstantHeightzero()A constant height provider that always returns the same value.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
minInclusive
The vertical anchor used as the minimum height.- Returns:
- the minimum anchor
- Since:
- 3.0.0
-
maxInclusive
The vertical anchor used as the maximum height.- Returns:
- the maximum anchor
- Since:
- 3.0.0
-
constant
A single fixed anchor.- Parameters:
value- the vertical anchor to use as the constant height- Returns:
- a constant height provider
- Since:
- 2.3.0
-
uniform
@AsOf("2.3.0") static UniformHeight uniform(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) Uniformly distributed between two anchors (inclusive).- Parameters:
minInclusive- the vertical anchor to use as the minimum heightmaxInclusive- the vertical anchor to use as the maximum height- Returns:
- a uniform height provider
- Since:
- 2.3.0
-
uniform
Creates a new uniform height builder.- Returns:
- a new uniform height builder
- Since:
- 3.0.0
-
trapezoid
@AsOf("2.3.0") static TrapezoidHeight trapezoid(VerticalAnchor minInclusive, VerticalAnchor maxInclusive, int plateau) Trapezoidal distribution with a flat plateau of the given height.- Parameters:
minInclusive- the vertical anchor to use as the minimum heightmaxInclusive- the vertical anchor to use as the maximum heightplateau- the length of the range in the middle that has a uniform distribution- Returns:
- a trapezoid height provider
- Since:
- 2.3.0
-
trapezoid
Creates a new trapezoid height builder.- Returns:
- a new trapezoid height builder
- Since:
- 3.0.0
-
biasedToBottom
@AsOf("2.3.0") static BiasedToBottomHeight biasedToBottom(VerticalAnchor minInclusive, VerticalAnchor maxInclusive, int inner) Weighted toward the bottom of the range.- Parameters:
minInclusive- the vertical anchor to use as the minimum heightmaxInclusive- the vertical anchor to use as the maximum heightinner- the bias factor; higher values push the distribution toward the bottom- Returns:
- a biased-to-bottom height provider
- Since:
- 2.3.0
-
biasedToBottom
Creates a new biased-to-bottom height builder.- Returns:
- a new biased-to-bottom height builder
- Since:
- 3.0.0
-
veryBiasedToBottom
@AsOf("2.3.0") static VeryBiasedToBottomHeight veryBiasedToBottom(VerticalAnchor minInclusive, VerticalAnchor maxInclusive, int inner) Weighted very strongly toward the bottom of the range.- Parameters:
minInclusive- the vertical anchor to use as the minimum heightmaxInclusive- the vertical anchor to use as the maximum heightinner- the bias factor; higher values push the distribution toward the bottom- Returns:
- a very biased-to-bottom height provider
- Since:
- 2.3.0
-
veryBiasedToBottom
Creates a new very biased-to-bottom height builder.- Returns:
- a new very biased-to-bottom height builder
- Since:
- 3.0.0
-
weightedList
A random value drawn from a weighted list of height providers.- Parameters:
distribution- the weighted pool of providers, which must not be empty- Returns:
- a weighted list height provider
- Since:
- 3.0.0
-
weightedList
Creates a new weighted list height builder.- Returns:
- a new weighted list height builder
- Since:
- 3.0.0
-
zero
A constant height provider that always returns the same value.- Returns:
- the constant height provider
- Since:
- 3.0.0
-
decode
Reads a Minecraft height provider into a wrapper.- Parameters:
minecraftHeightProvider- the height provider to read- Returns:
- the wrapper for it
- Since:
- 3.3.0
-