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

import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import net.minecraft.core.BlockPos;
import java.util.Random;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.StructureFeatureManager;
import net.minecraft.world.level.WorldGenLevel;
import com.mojang.serialization.Codec;
import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration;

public class SimpleBlockFeature extends Feature<SimpleBlockConfiguration> {
    public SimpleBlockFeature(final Codec<SimpleBlockConfiguration> codec) {
        super(codec);
    }
    
    @Override
    public boolean place(final WorldGenLevel bqu, final StructureFeatureManager bqq, final ChunkGenerator cha, final Random random, final BlockPos fu, final SimpleBlockConfiguration coo) {
        if (coo.placeOn.contains(bqu.getBlockState(fu.below())) && coo.placeIn.contains(bqu.getBlockState(fu)) && coo.placeUnder.contains(bqu.getBlockState(fu.above()))) {
            bqu.setBlock(fu, coo.toPlace, 2);
            return true;
        }
        return false;
    }
}
