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 PlaneTerrainGenerator implements Generator {
    private final int height;
    private final Block block;

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

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

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