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

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.datafixers.Dynamic;
import java.util.function.Function;
import net.minecraft.world.level.levelgen.placement.FrequencyDecoratorConfiguration;
import net.minecraft.world.level.levelgen.placement.SimpleFeatureDecorator;

public class LightGemChanceDecorator extends SimpleFeatureDecorator<FrequencyDecoratorConfiguration> {
    public LightGemChanceDecorator(final Function<Dynamic<?>, ? extends FrequencyDecoratorConfiguration> function) {
        super(function);
    }
    
    public Stream<BlockPos> place(final Random random, final FrequencyDecoratorConfiguration ckd, final BlockPos fk) {
        final int integer4;
        final int integer5;
        final int integer6;
        return IntStream.range(0, random.nextInt(random.nextInt(ckd.count) + 1)).<BlockPos>mapToObj(integer -> {
            integer4 = random.nextInt(16) + fk.getX();
            integer5 = random.nextInt(16) + fk.getZ();
            integer6 = random.nextInt(120) + 4;
            return new BlockPos(integer4, integer6, integer5);
        });
    }
}
