
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 net.minecraft.world.level.LevelAccessor;

public class WetlandHangingAdditionalGenerationConditionProcedure {
	public static boolean execute(LevelAccessor world, double x, double y, double z) {
		for (int i = 1 ; i < 100 ; i++) {
			if (world.getBlockState(BlockPos.containing(x, y + i, z)).canOcclude()) {
				int height = Mth.nextInt(RandomSource.create(), -35, 0);
				for (int j = i ; j > i + height ; j--) {
					world.setBlock(BlockPos.containing(x, y + j, z), Blocks.GREEN_STAINED_GLASS_PANE.defaultBlockState(), 3);
					if (world.getBlockState(BlockPos.containing(x, y + j - 1, z)).canOcclude()) {
						return true;
					}
				}
				return true;
			}
		}
		return true;
	}
}
