package org.cyclops.cyclopscore.recipe.xml;

import org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig;
import org.cyclops.cyclopscore.init.RecipeHandler;

/**
 * Condition handler for checking if configs are enabled.
 * @author rubensworks
 *
 */
public class ConfigRecipeConditionHandler implements IRecipeConditionHandler {

	@Override
	public boolean isSatisfied(RecipeHandler recipeHandler, String param) {
		ExtendedConfig<?> config = recipeHandler.getMod().getConfigHandler().getDictionary().get(param);
		return config != null && config.isEnabled();
	}

}

@@ -38,16 +38,158 @@
 e.xml;%0A%0A
+import net.minecraftforge.fml.common.Loader;%0Aimport net.minecraftforge.fml.common.ModContainer;%0Aimport org.apache.logging.log4j.util.Strings;%0A
 import o
@@ -249,16 +249,61 @@
 Config;%0A
+import org.cyclops.cyclopscore.init.ModBase;%0A
 import o
@@ -608,57 +608,535 @@
 %7B%0A%09%09
-ExtendedConfig%3C?%3E config = recipeHandler.getMod()
+String modId = null;%0A%09%09if (param.contains(%22:%22)) %7B%0A%09%09%09String%5B%5D split = param.split(%22:%22);%0A%09%09%09modId = split%5B0%5D;%0A%09%09%09param = split%5B1%5D;%0A%09%09%7D%0A%09%09ModBase mod;%0A%09%09if (!Strings.isEmpty(modId)) %7B%0A%09%09%09ModContainer untypedMod = Loader.instance().getIndexedModList().get(modId);%0A%09%09%09if (!(untypedMod.getMod() instanceof ModBase)) %7B%0A%09%09%09%09throw new IllegalArgumentException(%22The mod %22 + modId + %22 is not of type ModBase.%22);%0A%09%09%09%7D%0A%09%09%09mod = (ModBase) untypedMod.getMod();%0A%09%09%7D else %7B%0A%09%09%09mod = recipeHandler.getMod();%0A%09%09%7D%0A%09%09ExtendedConfig%3C?%3E config = mod
 .get

Allow custom mod to be set in ConfigRecipeConditionHandler