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.levelgen.ChunkGeneratorSettings;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.LevelAccessor;
import com.mojang.datafixers.Dynamic;
import java.util.function.Function;
import net.minecraft.world.level.levelgen.feature.configurations.LayerConfiguration;

public class FillLayerFeature extends Feature<LayerConfiguration> {
    public FillLayerFeature(final Function<Dynamic<?>, ? extends LayerConfiguration> function) {
        super(function);
    }
    
    @Override
    public boolean place(final LevelAccessor bjx, final ChunkGenerator<? extends ChunkGeneratorSettings> caa, final Random random, final BlockPos fk, final LayerConfiguration cgq) {
        final BlockPos.MutableBlockPos a7 = new BlockPos.MutableBlockPos();
        for (int integer8 = 0; integer8 < 16; ++integer8) {
            for (int integer9 = 0; integer9 < 16; ++integer9) {
                final int integer10 = fk.getX() + integer8;
                final int integer11 = fk.getZ() + integer9;
                final int integer12 = cgq.height;
                a7.set(integer10, integer12, integer11);
                if (bjx.getBlockState(a7).isAir()) {
                    bjx.setBlock(a7, cgq.state, 2);
                }
            }
        }
        return true;
    }
}
