package net.mcreator.azertymod.procedures;

import net.minecraft.world.World;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.Entity;

import net.mcreator.azertymod.AzertymodElements;

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

	public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
		if (dependencies.get("entity") == null) {
			System.err.println("Failed to load dependency entity for procedure RightClickOnAzertyumOre!");
			return;
		}
		if (dependencies.get("x") == null) {
			System.err.println("Failed to load dependency x for procedure RightClickOnAzertyumOre!");
			return;
		}
		if (dependencies.get("y") == null) {
			System.err.println("Failed to load dependency y for procedure RightClickOnAzertyumOre!");
			return;
		}
		if (dependencies.get("z") == null) {
			System.err.println("Failed to load dependency z for procedure RightClickOnAzertyumOre!");
			return;
		}
		if (dependencies.get("world") == null) {
			System.err.println("Failed to load dependency world for procedure RightClickOnAzertyumOre!");
			return;
		}
		Entity entity = (Entity) dependencies.get("entity");
		int x = (int) dependencies.get("x");
		int y = (int) dependencies.get("y");
		int z = (int) dependencies.get("z");
		World world = (World) dependencies.get("world");
		if ((entity.isSneaking())) {
			if ((world.isRaining())) {
				world.getWorldInfo().setRaining((false));
			}
			if (entity instanceof PlayerEntity && !world.isRemote) {
				((PlayerEntity) entity)
						.sendStatusMessage(new StringTextComponent((("La temp\u00E9rature du biome dans lequel se trouve ce bloc est de") + ""
								+ ((world.getBiome(new BlockPos((int) x, (int) y, (int) z)).getTemperature(new BlockPos((int) x, (int) y, (int) z))
										* 100.f)))),
								(false));
			}
		} else {
			if (entity instanceof PlayerEntity && !world.isRemote) {
				((PlayerEntity) entity).sendStatusMessage(
						new StringTextComponent(
								"Shift + clic droit pour: -enlever la pluie,  -dire la temp\u00E9rature du biome dans lequel se trouve le bloc"),
						(false));
			}
			if (entity instanceof PlayerEntity && !world.isRemote) {
				((PlayerEntity) entity).sendStatusMessage(new StringTextComponent("faire exploser pour spawn le liquide de ce mod"), (false));
			}
		}
	}
}
