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.ConfiguredFeature;
import com.mojang.serialization.Codec;

public class RandomBooleanFeatureConfiguration implements FeatureConfiguration {
    public static final Codec<RandomBooleanFeatureConfiguration> CODEC;
    public final ConfiguredFeature<?, ?> featureTrue;
    public final ConfiguredFeature<?, ?> featureFalse;
    
    public RandomBooleanFeatureConfiguration(final ConfiguredFeature<?, ?> ckb1, final ConfiguredFeature<?, ?> ckb2) {
        this.featureTrue = ckb1;
        this.featureFalse = ckb2;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)ConfiguredFeature.CODEC.fieldOf("feature_true").forGetter(coe -> coe.featureTrue), (App)ConfiguredFeature.CODEC.fieldOf("feature_false").forGetter(coe -> coe.featureFalse)).apply(instance, (BiFunction)RandomBooleanFeatureConfiguration::new));
    }
}
