Module gomint.api

Class ChunkGenerator

    • Constructor Detail

      • ChunkGenerator

        public ChunkGenerator​(World world,
                              GeneratorContext context)
        Create a new chunk generator
        Parameters:
        world - for which this generator should generate chunks
        context - with which this generator should generate chunks
    • Method Detail

      • generate

        public abstract Chunk generate​(int x,
                                       int z)
        Generate a chunk at the given coordinates. You have to return a fully built chunk, you can request one with World.generateEmptyChunk(int, int)
        Parameters:
        x - coordinate of the chunk
        z - coordinate of the chunk
        Returns:
        proper populated chunk
      • getSpawnPoint

        public abstract BlockPosition getSpawnPoint()
        When you generate a new world using this chunk generator this method returns the worlds spawn. At this stage no blocks are loaded.
        Returns:
        block position of the spawn of this new world
      • populate

        public abstract void populate​(Chunk chunk)
        Populate (generate additional objects) for the given chunk
        Parameters:
        chunk - which should be populated
      • close

        public void close()
        Close the generator