package net.mcreator.azertymod.procedures;

import net.minecraft.world.World;
import net.minecraft.util.math.BlockPos;

import net.mcreator.azertymod.block.BatterieBlock;
import net.mcreator.azertymod.AzertymodVariables;
import net.mcreator.azertymod.AzertymodElements;

@AzertymodElements.ModElement.Tag
public class BatterieBlockAddedProcedure extends AzertymodElements.ModElement {
	public BatterieBlockAddedProcedure(AzertymodElements instance) {
		super(instance, 37);
	}

	public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
		if (dependencies.get("x") == null) {
			System.err.println("Failed to load dependency x for procedure BatterieBlockAdded!");
			return;
		}
		if (dependencies.get("y") == null) {
			System.err.println("Failed to load dependency y for procedure BatterieBlockAdded!");
			return;
		}
		if (dependencies.get("z") == null) {
			System.err.println("Failed to load dependency z for procedure BatterieBlockAdded!");
			return;
		}
		if (dependencies.get("world") == null) {
			System.err.println("Failed to load dependency world for procedure BatterieBlockAdded!");
			return;
		}
		int x = (int) dependencies.get("x");
		int y = (int) dependencies.get("y");
		int z = (int) dependencies.get("z");
		World world = (World) dependencies.get("world");
		double i = 0;
		AzertymodVariables.MapVariables.get(world).Max_energy = (double) 100;
		AzertymodVariables.MapVariables.get(world).syncData(world);
		for (int index0 = 0; index0 < (int) (9); index0++) {
			i = (double) ((i) + 1);
			if (((world.getBlockState(new BlockPos((int) x, (int) (y - (i)), (int) z))).getBlock() == BatterieBlock.block.getDefaultState()
					.getBlock())) {
				AzertymodVariables.MapVariables.get(world).Max_energy = (double) ((AzertymodVariables.MapVariables.get(world).Max_energy) + 100);
				AzertymodVariables.MapVariables.get(world).syncData(world);
			}
		}
	}
}
