package net.mcreator.cawezsmantletostratus.procedures;

import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.BlockState;
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 CliffDripAdditionalGenerationConditionProcedure {
	public static boolean execute(LevelAccessor world, double x, double y, double z) {
		int offset = 0;
		for (int i = 0 ; i < Mth.nextInt(RandomSource.create(), 0, 6) ; i ++ ) {
			offset ++;
			world.setBlock(BlockPos.containing(x, y + offset, z), Blocks.POINTED_DRIPSTONE.defaultBlockState(), 3);
			{
				String _value = "base";
				BlockPos _pos = BlockPos.containing(x, y + offset, z);
				BlockState _bs = world.getBlockState(_pos);
				if (_bs.getBlock().getStateDefinition().getProperty("thickness") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())
					world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);
			}	
		}
		for (int i = 0 ; i < Mth.nextInt(RandomSource.create(), 0, 6) ; i ++ ) {
			offset ++;
			world.setBlock(BlockPos.containing(x, y + offset, z), Blocks.POINTED_DRIPSTONE.defaultBlockState(), 3);
			{
				String _value = "middle";
				BlockPos _pos = BlockPos.containing(x, y + offset, z);
				BlockState _bs = world.getBlockState(_pos);
				if (_bs.getBlock().getStateDefinition().getProperty("thickness") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())
					world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);
			}	
		}
		for (int i = 0 ; i < Mth.nextInt(RandomSource.create(), 0, 6) ; i ++ ) {
			offset ++;
			world.setBlock(BlockPos.containing(x, y + offset, z), Blocks.POINTED_DRIPSTONE.defaultBlockState(), 3);
			{
				String _value = "frustum";
				BlockPos _pos = BlockPos.containing(x, y + offset, z);
				BlockState _bs = world.getBlockState(_pos);
				if (_bs.getBlock().getStateDefinition().getProperty("thickness") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())
					world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);
			}	
		}
		for (int i = 0 ; i < 1 ; i ++ ) {
			offset ++;
			world.setBlock(BlockPos.containing(x, y + offset, z), Blocks.POINTED_DRIPSTONE.defaultBlockState(), 3);
			{
				String _value = "tip";
				BlockPos _pos = BlockPos.containing(x, y + offset, z);
				BlockState _bs = world.getBlockState(_pos);
				if (_bs.getBlock().getStateDefinition().getProperty("thickness") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())
					world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);
			}	
		}
		return true;
	}
}
