Interface WorldGenerator

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface WorldGenerator
Fills the chunks of a world when they are generated for the first time.

Plugins provide one through Server.createWorld(WorldSpec), or replace the default one by registering it as a service. Generation runs on chunk worker threads: implementations must be thread-safe.

Since:
0.1.0
  • Method Details

    • generate

      void generate(GeneratedChunk chunk)
      Fills a freshly created chunk.
      Parameters:
      chunk - the chunk to fill
      Since:
      0.1.0
    • dimensionType

      default DimensionTypeDefinition dimensionType()
      Returns the dimension type of the worlds this generator drives, the overworld by default.
      Returns:
      the dimension type of the worlds this generator drives, the overworld by default
      Since:
      0.1.0
    • describeForSave

      default GenerationDescriptor describeForSave()
      Returns how this generator is described in level.dat, for vanilla tools to read.
      Returns:
      how this generator is described in level.dat, for vanilla tools to read
      Since:
      0.1.0
    • generatesStructures

      default boolean generatesStructures()
      Returns true if datapack structures are placed on top of this generator.
      Returns:
      true if datapack structures are placed on top of this generator
      Since:
      0.1.0