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 SimpleBlockConfiguration implements FeatureConfiguration {
    public static final Codec<SimpleBlockConfiguration> CODEC;
    public final BlockState toPlace;
    public final List<BlockState> placeOn;
    public final List<BlockState> placeIn;
    public final List<BlockState> placeUnder;
    
    public SimpleBlockConfiguration(final BlockState cfj, final List<BlockState> list2, final List<BlockState> list3, final List<BlockState> list4) {
        this.toPlace = cfj;
        this.placeOn = list2;
        this.placeIn = list3;
        this.placeUnder = list4;
    }
    
    static {
        CODEC = RecordCodecBuilder.create(instance -> ((RecordCodecBuilder.Instance)instance).group((App)BlockState.CODEC.fieldOf("to_place").forGetter(coo -> coo.toPlace), (App)BlockState.CODEC.listOf().fieldOf("place_on").forGetter(coo -> coo.placeOn), (App)BlockState.CODEC.listOf().fieldOf("place_in").forGetter(coo -> coo.placeIn), (App)BlockState.CODEC.listOf().fieldOf("place_under").forGetter(coo -> coo.placeUnder)).apply(instance, SimpleBlockConfiguration::new));
    }
}
