github.com/df-mc/dragonfly@v0.9.13/server/world/generator.go (about)

     1  package world
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/world/chunk"
     5  )
     6  
     7  // Generator handles the generating of newly created chunks. Worlds have one generator which is used to
     8  // generate chunks when the provider of the world cannot find a chunk at a given chunk position.
     9  type Generator interface {
    10  	// GenerateChunk generates a chunk at a chunk position passed. The generator sets blocks in the chunk that
    11  	// is passed to the method.
    12  	GenerateChunk(pos ChunkPos, chunk *chunk.Chunk)
    13  }
    14  
    15  // NopGenerator is the default generator a world. It places no blocks in the world which results in a void
    16  // world.
    17  type NopGenerator struct{}
    18  
    19  // GenerateChunk ...
    20  func (NopGenerator) GenerateChunk(ChunkPos, *chunk.Chunk) {}