package net.minecraft.world.level.levelgen.carver;

import net.minecraft.core.Registry;
import java.util.BitSet;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.core.BlockPos;
import java.util.function.Function;
import net.minecraft.world.level.chunk.ChunkAccess;
import java.util.Random;
import com.mojang.serialization.Codec;

public class ConfiguredWorldCarver<WC extends CarverConfiguration> {
    public static final Codec<ConfiguredWorldCarver<?>> CODEC;
    public final WorldCarver<WC> worldCarver;
    public final WC config;
    
    public ConfiguredWorldCarver(final WorldCarver<WC> cjh, final WC cja) {
        this.worldCarver = cjh;
        this.config = cja;
    }
    
    public boolean isStartChunk(final Random random, final int integer2, final int integer3) {
        return this.worldCarver.isStartChunk(random, integer2, integer3, this.config);
    }
    
    public boolean carve(final ChunkAccess cgy, final Function<BlockPos, Biome> function, final Random random, final int integer4, final int integer5, final int integer6, final int integer7, final int integer8, final BitSet bitSet) {
        return this.worldCarver.carve(cgy, function, random, integer4, integer5, integer6, integer7, integer8, bitSet, this.config);
    }
    
    static {
        CODEC = Registry.CARVER.dispatch("name", cjc -> cjc.worldCarver, (Function)WorldCarver::configuredCodec);
    }
}
