package net.mcreator.cawezsmantletostratus.procedures;

import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Mth;
public class InvertedFloorAdditionalGenerationConditionProcedure {
	public static boolean execute(LevelAccessor world, double x, double y, double z) {
		for (int xx = 0 ; xx < 16 ; xx++){
		for (int yy = 0 ; yy < 16 ; yy++){
		
		for (int i = 100 ; i < 254 ; i ++) {
			if ((world.getBlockState(BlockPos.containing(x+xx, i, z+yy))).getBlock() == Blocks.CRACKED_STONE_BRICKS && (world.getBlockState(BlockPos.containing(x+xx, i-1, z+yy))).getBlock() == Blocks.AIR) {
				world.setBlock(BlockPos.containing(x+xx, i+2, z+yy), Blocks.CRACKED_DEEPSLATE_BRICKS.defaultBlockState(), 3);
				world.setBlock(BlockPos.containing(x+xx, i+1, z+yy), Blocks.CRACKED_DEEPSLATE_BRICKS.defaultBlockState(), 3);
				if (Mth.nextInt(RandomSource.create(), 1, 100) != 1) {
					world.setBlock(BlockPos.containing(x+xx, i, z+yy), Blocks.CRACKED_POLISHED_BLACKSTONE_BRICKS.defaultBlockState(), 3);
				} else {
					world.setBlock(BlockPos.containing(x+xx, i, z+yy), Blocks.SEA_LANTERN.defaultBlockState(), 3);
				}

			}
		}
		}
		}
		return true;
	}
}
