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

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

public class ConfiguredSurfaceBuilder<SC extends SurfaceBuilderConfiguration> {
    public static final Codec<ConfiguredSurfaceBuilder<?>> CODEC;
    public final SurfaceBuilder<SC> surfaceBuilder;
    public final SC config;
    
    public ConfiguredSurfaceBuilder(final SurfaceBuilder<SC> cvw, final SC cvy) {
        this.surfaceBuilder = cvw;
        this.config = cvy;
    }
    
    public void apply(final Random random, final ChunkAccess cgy, final Biome bre, final int integer4, final int integer5, final int integer6, final double double7, final BlockState cfj8, final BlockState cfj9, final int integer10, final long long11) {
        this.surfaceBuilder.apply(random, cgy, bre, integer4, integer5, integer6, double7, cfj8, cfj9, integer10, long11, this.config);
    }
    
    public void initNoise(final long long1) {
        this.surfaceBuilder.initNoise(long1);
    }
    
    public SC getSurfaceBuilderConfiguration() {
        return this.config;
    }
    
    static {
        CODEC = Registry.SURFACE_BUILDER.dispatch("name", cvj -> cvj.surfaceBuilder, (Function)SurfaceBuilder::configuredCodec);
    }
}
