package net.minecraft.world.level.levelgen.feature.configurations;

import java.util.function.BiFunction;
import com.mojang.datafixers.kinds.Applicative;
import com.mojang.datafixers.kinds.App;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.world.level.block.state.BlockState;
import com.mojang.serialization.Codec;

public class LayerConfiguration implements FeatureConfiguration {
    public static final Codec<LayerConfiguration> CODEC;
    public final int height;
    public final BlockState state;
    
    public LayerConfiguration(final int integer, final BlockState cfj) {
        this.height = integer;
        this.state = cfj;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)Codec.INT.fieldOf("height").forGetter(cnv -> cnv.height), (App)BlockState.CODEC.fieldOf("state").forGetter(cnv -> cnv.state)).apply(instance, (BiFunction)LayerConfiguration::new));
    }
}
