package studio.halbear.hem.procedures;

import studio.halbear.hem.HemMod;

import net.minecraft.entity.Entity;

import java.util.Map;

public class EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure {

	public static void executeProcedure(Map<String, Object> dependencies) {
		if (dependencies.get("entity") == null) {
			if (!dependencies.containsKey("entity"))
				HemMod.LOGGER.warn("Failed to load dependency entity for procedure EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawn!");
			return;
		}
		Entity entity = (Entity) dependencies.get("entity");
		entity.getPersistentData().putDouble("expirationtimer", (60 + 200 * Math.random()));
		entity.getPersistentData().putBoolean("ticking", (true));
		entity.setMotion((entity.getLookVec().x * 0.5), (entity.getMotion().getY()), (entity.getLookVec().z * 0.5));
	}
}
