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

import net.minecraft.world.level.levelgen.feature.configurations.DecoratorConfiguration;
import java.util.stream.Stream;
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;

public class LakeLavaPlacementDecorator extends FeatureDecorator<ChanceDecoratorConfiguration> {
    public LakeLavaPlacementDecorator(final Function<Dynamic<?>, ? extends ChanceDecoratorConfiguration> function) {
        super(function);
    }
    
    @Override
    public Stream<BlockPos> getPositions(final LevelAccessor bjx, final ChunkGenerator<? extends ChunkGeneratorSettings> caa, final Random random, final ChanceDecoratorConfiguration cjd, final BlockPos fk) {
        if (random.nextInt(cjd.chance / 10) == 0) {
            final int integer7 = random.nextInt(16) + fk.getX();
            final int integer8 = random.nextInt(16) + fk.getZ();
            final int integer9 = random.nextInt(random.nextInt(caa.getGenDepth() - 8) + 8);
            if (integer9 < bjx.getSeaLevel() || random.nextInt(cjd.chance / 8) == 0) {
                return Stream.<BlockPos>of(new BlockPos(integer7, integer9, integer8));
            }
        }
        return Stream.<BlockPos>empty();
    }
}
