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

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

public class CountDepthAverageDecorator extends SimpleFeatureDecorator<DepthAverageConfigation> {
    public CountDepthAverageDecorator(final Codec<DepthAverageConfigation> codec) {
        super(codec);
    }
    
    public Stream<BlockPos> place(final Random random, final DepthAverageConfigation cry, final BlockPos fu) {
        final int integer5 = cry.count;
        final int integer6 = cry.baseline;
        final int integer7 = cry.spread;
        final int integer8;
        final int integer9;
        final int n;
        final int n2;
        final int integer10;
        return IntStream.range(0, integer5).<BlockPos>mapToObj(integer5 -> {
            integer8 = random.nextInt(16) + fu.getX();
            integer9 = random.nextInt(16) + fu.getZ();
            integer10 = random.nextInt(n) + random.nextInt(n) - n + n2;
            return new BlockPos(integer8, integer10, integer9);
        });
    }
}
