package studio.halbear.hem.procedures;

import studio.halbear.hem.HemMod;

import java.util.Map;

public class BlueleafLavenderConditionProcedure {

	public static boolean executeProcedure(Map<String, Object> dependencies) {
		if (dependencies.get("x") == null) {
			if (!dependencies.containsKey("x"))
				HemMod.LOGGER.warn("Failed to load dependency x for procedure BlueleafLavenderCondition!");
			return false;
		}
		if (dependencies.get("z") == null) {
			if (!dependencies.containsKey("z"))
				HemMod.LOGGER.warn("Failed to load dependency z for procedure BlueleafLavenderCondition!");
			return false;
		}
		double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x");
		double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z");
		if (z < 0 || z <= 0 && x % 24 != 0 || z <= 16 && z > 0 && x % 24 == 0) {
			return true;
		}
		return false;
	}
}
