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;
import net.minecraft.world.level.levelgen.feature.configurations.NoneDecoratorConfiguration;

public class DarkOakTreePlacementDecorator extends FeatureDecorator<NoneDecoratorConfiguration> {
    public DarkOakTreePlacementDecorator(final Codec<NoneDecoratorConfiguration> codec) {
        super(codec);
    }
    
    @Override
    public Stream<BlockPos> getPositions(final LevelAccessor bqc, final ChunkGenerator cha, final Random random, final NoneDecoratorConfiguration cnz, final BlockPos fu) {
        final int integer2;
        final int integer3;
        final int integer4;
        final int integer5;
        final int integer6;
        return IntStream.range(0, 16).<BlockPos>mapToObj(integer -> {
            integer2 = integer / 4;
            integer3 = integer % 4;
            integer4 = integer2 * 4 + 1 + random.nextInt(3) + fu.getX();
            integer5 = integer3 * 4 + 1 + random.nextInt(3) + fu.getZ();
            integer6 = bqc.getHeight(Heightmap.Types.MOTION_BLOCKING, integer4, integer5);
            return new BlockPos(integer4, integer6, integer5);
        });
    }
}
