package eu.mhsl.minenet.minigames.world.generator.terrain;

import net.minestom.server.instance.block.Block;
import net.minestom.server.instance.generator.GenerationUnit;
import net.minestom.server.instance.generator.Generator;
import org.jetbrains.annotations.NotNull;

public class FlatTerrainGenerator implements Generator {
    private final int height;
    private final Block block;

    public FlatTerrainGenerator(int height, Block block) {
        this.height = height;
        this.block = block;
    }

    FlatTerrainGenerator() {
        this.height = 5;
        this.block = Block.GRASS_BLOCK;
    }

    @Override
    public void generate(@NotNull GenerationUnit unit) {
        unit.modifier().fillHeight(0, height, block);
    }
}
