package eu.mhsl.minenet.minigames.instance.game.stateless.types.fastbridge;

import eu.mhsl.minenet.minigames.world.generator.featureEnriched.ValeGenerator;
import eu.mhsl.minenet.minigames.world.generator.terrain.BaseGenerator;
import net.minestom.server.instance.block.Block;

public class FastbridgeChunkgenerator extends BaseGenerator {
    public FastbridgeChunkgenerator() {
        this.addMixIn(unit -> {
            if(unit.absoluteStart().chunkZ() % 2 == 0) {
                unit.modifier().fill(Block.BARRIER);
                return;
            }

            if(unit.absoluteStart().chunkX() != 1 && unit.absoluteStart().chunkX() != 3) return;
            for(int x = 5; x <= 10; x++) {
                for(int z = 5; z <= 10; z++) {
                    unit.modifier().setRelative(x, 64, z, unit.absoluteStart().chunkX() == 3 ? Block.GOLD_BLOCK : Block.GRASS_BLOCK);
                }
            }
        });

        ValeGenerator vale = new ValeGenerator();
        vale.setXShiftMultiplier(integer -> 0.5d);
        vale.setHeightNoiseMultiplier(integer -> 2);
        vale.setXShiftOffset(integer -> 40d);
        this.addMixIn(vale);
    }
}
