package net.minecraft.world.level.levelgen.feature.configurations;

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

public class HugeMushroomFeatureConfiguration implements FeatureConfiguration {
    public static final Codec<HugeMushroomFeatureConfiguration> CODEC;
    public final BlockStateProvider capProvider;
    public final BlockStateProvider stemProvider;
    public final int foliageRadius;
    
    public HugeMushroomFeatureConfiguration(final BlockStateProvider cpo1, final BlockStateProvider cpo2, final int integer) {
        this.capProvider = cpo1;
        this.stemProvider = cpo2;
        this.foliageRadius = integer;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)BlockStateProvider.CODEC.fieldOf("cap_provider").forGetter(cnt -> cnt.capProvider), (App)BlockStateProvider.CODEC.fieldOf("stem_provider").forGetter(cnt -> cnt.stemProvider), (App)Codec.INT.fieldOf("foliage_radius").withDefault(2).forGetter(cnt -> cnt.foliageRadius)).apply(instance, HugeMushroomFeatureConfiguration::new));
    }
}
