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

import net.minecraft.world.level.levelgen.feature.configurations.DecoratorConfiguration;
import net.minecraft.world.level.levelgen.Heightmap;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import net.minecraft.core.BlockPos;
import java.util.Random;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.LevelAccessor;
import com.mojang.serialization.Codec;

public class ForestRockPlacementDecorator extends FeatureDecorator<FrequencyDecoratorConfiguration> {
    public ForestRockPlacementDecorator(final Codec<FrequencyDecoratorConfiguration> codec) {
        super(codec);
    }
    
    @Override
    public Stream<BlockPos> getPositions(final LevelAccessor bqc, final ChunkGenerator cha, final Random random, final FrequencyDecoratorConfiguration csf, final BlockPos fu) {
        final int integer7 = random.nextInt(csf.count);
        final int integer8;
        final int integer9;
        final int integer10;
        return IntStream.range(0, integer7).<BlockPos>mapToObj(integer -> {
            integer8 = random.nextInt(16) + fu.getX();
            integer9 = random.nextInt(16) + fu.getZ();
            integer10 = bqc.getHeight(Heightmap.Types.MOTION_BLOCKING, integer8, integer9);
            return new BlockPos(integer8, integer10, integer9);
        });
    }
}
