Interface GenerationUnit

All Known Implementing Classes:
GeneratorImpl.UnitImpl

public interface GenerationUnit
Represents an area that can be generated.

The size is guaranteed to be a multiple of 16 (section).

  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Point
    The absolute end (max x, y, z) of this unit.
    @NotNull Point
    The absolute start (min x, y, z) of this unit.
    void
    fork(@NotNull Consumer<@NotNull Block.Setter> consumer)
    Creates a fork of this unit depending on the blocks placed within the consumer.
    fork(@NotNull Point start, @NotNull Point end)
    Creates a fork of this unit, which will be applied to the instance whenever possible.
    @NotNull UnitModifier
    This unit's modifier, used to place blocks and biomes within this unit.
    @NotNull Point
    The size of this unit in blocks.
    default @NotNull List<GenerationUnit>
    Divides this unit into the smallest independent units.
  • Method Details

    • modifier

      @NotNull @NotNull UnitModifier modifier()
      This unit's modifier, used to place blocks and biomes within this unit.
      Returns:
      the modifier
    • size

      @NotNull @NotNull Point size()
      The size of this unit in blocks.

      Guaranteed to be a multiple of 16.

      Returns:
      the size of this unit
    • absoluteStart

      @NotNull @NotNull Point absoluteStart()
      The absolute start (min x, y, z) of this unit.
      Returns:
      the absolute start
    • absoluteEnd

      @NotNull @NotNull Point absoluteEnd()
      The absolute end (max x, y, z) of this unit.
      Returns:
      the absolute end
    • fork

      @NotNull @NotNull GenerationUnit fork(@NotNull @NotNull Point start, @NotNull @NotNull Point end)
      Creates a fork of this unit, which will be applied to the instance whenever possible.
      Parameters:
      start - the start of the fork
      end - the end of the fork
      Returns:
      the fork
    • fork

      void fork(@NotNull @NotNull Consumer<@NotNull Block.Setter> consumer)
      Creates a fork of this unit depending on the blocks placed within the consumer.
      Parameters:
      consumer - the consumer
    • subdivide

      @NotNull default @NotNull List<GenerationUnit> subdivide()
      Divides this unit into the smallest independent units.
      Returns:
      an immutable list of independent units