package net.mcreator.cawezsmantletostratus.procedures;

import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Mth;
import net.minecraft.core.BlockPos;
import org.checkerframework.checker.units.qual.radians;

public class StarstarAdditionalGenerationConditionProcedure {
	public static boolean execute(LevelAccessor world, double x, double y, double z) {

	
		//world.setBlock(BlockPos.containing(Mth.nextInt(RandomSource.create(), (int) x, 10), y, z), Blocks.DEEPSLATE_LAPIS_ORE.defaultBlockState(), 3);

		int radius = Mth.nextInt(RandomSource.create(), 5, 12);

		for (int i = 0; i < 10 ; i ++) {
			double dx = Mth.nextInt(RandomSource.create(), -10, 10) / 10.0;
			double dy = Mth.nextInt(RandomSource.create(), -10, 10) / 10.0;
			double dz = Mth.nextInt(RandomSource.create(), -10, 10) / 10.0;

			
			for (int step = 0 ; step < radius ; step ++) {
				if (Mth.nextInt(RandomSource.create(), 0, 10) < 5) { 
					world.setBlock(BlockPos.containing(x + dx * step, y + dy * step, z + dz * step), Blocks.GILDED_BLACKSTONE.defaultBlockState(), 3);
				} else {
					world.setBlock(BlockPos.containing(x + dx * step, y + dy * step, z + dz * step), Blocks.GLOWSTONE.defaultBlockState(), 3);
				}
			}
			
		}


		world.setBlock(BlockPos.containing(x, y, z), Blocks.LAPIS_BLOCK.defaultBlockState(), 3);
		world.setBlock(BlockPos.containing(x+1, y, z), Blocks.LAPIS_BLOCK.defaultBlockState(), 3);
		world.setBlock(BlockPos.containing(x-1, y, z), Blocks.LAPIS_BLOCK.defaultBlockState(), 3);
		world.setBlock(BlockPos.containing(x, y+1, z), Blocks.LAPIS_BLOCK.defaultBlockState(), 3);
		world.setBlock(BlockPos.containing(x, y-1, z), Blocks.LAPIS_BLOCK.defaultBlockState(), 3);
		world.setBlock(BlockPos.containing(x, y, z+1), Blocks.LAPIS_BLOCK.defaultBlockState(), 3);
		world.setBlock(BlockPos.containing(x, y, z-1), Blocks.LAPIS_BLOCK.defaultBlockState(), 3);

		
		return true;
	}
}
