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.levelgen.feature.MineshaftFeature;
import com.mojang.serialization.Codec;

public class MineshaftConfiguration implements FeatureConfiguration {
    public static final Codec<MineshaftConfiguration> CODEC;
    public final double probability;
    public final MineshaftFeature.Type type;
    
    public MineshaftConfiguration(final double double1, final MineshaftFeature.Type b) {
        this.probability = double1;
        this.type = b;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)Codec.DOUBLE.fieldOf("probability").forGetter(cnw -> cnw.probability), (App)MineshaftFeature.Type.CODEC.fieldOf("type").forGetter(cnw -> cnw.type)).apply(instance, (BiFunction)MineshaftConfiguration::new));
    }
}
