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 java.util.List;
import net.minecraft.world.level.block.state.BlockState;
import com.mojang.serialization.Codec;

public class DiskConfiguration implements FeatureConfiguration {
    public static final Codec<DiskConfiguration> CODEC;
    public final BlockState state;
    public final int radius;
    public final int ySize;
    public final List<BlockState> targets;
    
    public DiskConfiguration(final BlockState cfj, final int integer2, final int integer3, final List<BlockState> list) {
        this.state = cfj;
        this.radius = integer2;
        this.ySize = integer3;
        this.targets = list;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)BlockState.CODEC.fieldOf("state").forGetter(cnp -> cnp.state), (App)Codec.INT.fieldOf("radius").withDefault(0).forGetter(cnp -> cnp.radius), (App)Codec.INT.fieldOf("y_size").withDefault(0).forGetter(cnp -> cnp.ySize), (App)BlockState.CODEC.listOf().fieldOf("targets").forGetter(cnp -> cnp.targets)).apply(instance, DiskConfiguration::new));
    }
}
