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;

public class PillarAdditionalGenerationConditionProcedure {
	public static boolean execute(LevelAccessor world, double x, double y, double z) {
		int height = Mth.nextInt(RandomSource.create(), 5, 50);
		for (int i = -1; i < height; i++) {
			world.setBlock(BlockPos.containing(x, y+i, z), Blocks.OBSIDIAN.defaultBlockState(), 3);

			int swipeOff = 1;
			if (Mth.nextInt(RandomSource.create(), 1, 2) == 1) {
				while (Mth.nextInt(RandomSource.create(), 1, 2) == 1) {
					if (swipeOff == 1) {
						world.setBlock(BlockPos.containing(x, y+i, z+swipeOff), Blocks.TINTED_GLASS.defaultBlockState(), 3);
						world.setBlock(BlockPos.containing(x, y+i, z), Blocks.CRYING_OBSIDIAN.defaultBlockState(), 3);
					} else {
	
						world.setBlock(BlockPos.containing(x, y+i, z+swipeOff), Blocks.TINTED_GLASS.defaultBlockState(), 3);
					}
					swipeOff ++;
				}
			}

		}
		return true;
	}
	
}
