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

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.levelgen.GenerationStep;
import com.mojang.serialization.Codec;
import net.minecraft.world.level.levelgen.feature.configurations.DecoratorConfiguration;

public class CarvingMaskDecoratorConfiguration implements DecoratorConfiguration {
    public static final Codec<CarvingMaskDecoratorConfiguration> CODEC;
    protected final GenerationStep.Carving step;
    protected final float probability;
    
    public CarvingMaskDecoratorConfiguration(final GenerationStep.Carving a, final float float2) {
        this.step = a;
        this.probability = float2;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)GenerationStep.Carving.CODEC.fieldOf("step").forGetter(cre -> cre.step), (App)Codec.FLOAT.fieldOf("probability").forGetter(cre -> cre.probability)).apply(instance, (BiFunction)CarvingMaskDecoratorConfiguration::new));
    }
}
