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

public class FrequencyChanceDecoratorConfiguration implements DecoratorConfiguration {
    public static final Codec<FrequencyChanceDecoratorConfiguration> CODEC;
    public final int count;
    public final float chance;
    
    public FrequencyChanceDecoratorConfiguration(final int integer, final float float2) {
        this.count = integer;
        this.chance = float2;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)Codec.INT.fieldOf("count").forGetter(cse -> cse.count), (App)Codec.FLOAT.fieldOf("chance").forGetter(cse -> cse.chance)).apply(instance, (BiFunction)FrequencyChanceDecoratorConfiguration::new));
    }
}
