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 java.util.List;
import com.mojang.serialization.Codec;

public class RandomRandomFeatureConfiguration implements FeatureConfiguration {
    public static final Codec<RandomRandomFeatureConfiguration> CODEC;
    public final List<ConfiguredFeature<?, ?>> features;
    public final int count;
    
    public RandomRandomFeatureConfiguration(final List<ConfiguredFeature<?, ?>> list, final int integer) {
        this.features = list;
        this.count = integer;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)ConfiguredFeature.CODEC.listOf().fieldOf("features").forGetter(coh -> coh.features), (App)Codec.INT.fieldOf("count").withDefault(0).forGetter(coh -> coh.count)).apply(instance, (BiFunction)RandomRandomFeatureConfiguration::new));
    }
}
