Interface HeightProvider

All Superinterfaces:
Wrapper
All Known Subinterfaces:
BiasedToBottomHeight, ConstantHeight, TrapezoidHeight, UniformHeight, VeryBiasedToBottomHeight, WeightedListHeight

@NullMarked @AsOf("2.3.0") public interface HeightProvider extends Wrapper
Wraps the HeightProvider family. Sampling occurs Minecraft code side, so this wrapper only carries the anchors/shape parameters.
Since:
2.3.0
See Also:
  • Method Details

    • minInclusive

      @AsOf("3.0.0") VerticalAnchor minInclusive()
      The vertical anchor used as the minimum height.
      Returns:
      the minimum anchor
      Since:
      3.0.0
    • maxInclusive

      @AsOf("3.0.0") VerticalAnchor maxInclusive()
      The vertical anchor used as the maximum height.
      Returns:
      the maximum anchor
      Since:
      3.0.0
    • constant

      @AsOf("2.3.0") static ConstantHeight constant(VerticalAnchor value)
      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 height
      maxInclusive - the vertical anchor to use as the maximum height
      Returns:
      a uniform height provider
      Since:
      2.3.0
    • uniform

      @AsOf("3.0.0") static UniformHeight.Builder 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 height
      maxInclusive - the vertical anchor to use as the maximum height
      plateau - the length of the range in the middle that has a uniform distribution
      Returns:
      a trapezoid height provider
      Since:
      2.3.0
    • trapezoid

      @AsOf("3.0.0") static TrapezoidHeight.Builder 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 height
      maxInclusive - the vertical anchor to use as the maximum height
      inner - the bias factor; higher values push the distribution toward the bottom
      Returns:
      a biased-to-bottom height provider
      Since:
      2.3.0
    • biasedToBottom

      @AsOf("3.0.0") static BiasedToBottomHeight.Builder 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 height
      maxInclusive - the vertical anchor to use as the maximum height
      inner - the bias factor; higher values push the distribution toward the bottom
      Returns:
      a very biased-to-bottom height provider
      Since:
      2.3.0
    • veryBiasedToBottom

      @AsOf("3.0.0") static VeryBiasedToBottomHeight.Builder veryBiasedToBottom()
      Creates a new very biased-to-bottom height builder.
      Returns:
      a new very biased-to-bottom height builder
      Since:
      3.0.0
    • weightedList

      @AsOf("3.0.0") static WeightedListHeight weightedList(WeightedList<HeightProvider> distribution)
      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

      @AsOf("3.0.0") static WeightedListHeight.Builder weightedList()
      Creates a new weighted list height builder.
      Returns:
      a new weighted list height builder
      Since:
      3.0.0
    • zero

      @AsOf("3.0.0") static ConstantHeight zero()
      A constant height provider that always returns the same value.
      Returns:
      the constant height provider
      Since:
      3.0.0
    • decode

      @AsOf("3.3.0") static HeightProvider decode(Object minecraftHeightProvider)
      Reads a Minecraft height provider into a wrapper.
      Parameters:
      minecraftHeightProvider - the height provider to read
      Returns:
      the wrapper for it
      Since:
      3.3.0