package com.scottkillen.mod.dendrology.compat.minechem;

import com.scottkillen.mod.dendrology.content.OverworldTreeSpecies;
import com.scottkillen.mod.dendrology.util.log.Logger;
import cpw.mods.fml.common.Loader;
import minechem.api.RecipeAPI;
import net.minecraft.item.ItemStack;

public enum MinechemMod
{
    ;

    public static void integrate()
    {
        if (Loader.isModLoaded("minechem"))
        {
            addDecomposerRecipes();
        } else Logger.info("Minechem mod not present. Integration skipped.");
    }

    private static void addDecomposerRecipes()
    {
        Logger.info("Adding Minechem decomposer recipes.");
        for (final OverworldTreeSpecies tree : OverworldTreeSpecies.values())
        {
            //noinspection ObjectAllocationInLoop
            final ItemStack planks = new ItemStack(tree.getPlanksBlock(), 1, tree.getPlanksMeta());
            if (RecipeAPI.addDecompositionRecipe(planks, "2 cellulose"))
                Logger.info("Added Minechem decomposer recipe for %s planks.", tree.getName());

            //noinspection ObjectAllocationInLoop
            final ItemStack slab = new ItemStack(tree.getSingleSlabBlock(), 1, tree.getSlabMeta());
            if (RecipeAPI.addDecompositionRecipe(slab, "2 cellulose"))
                Logger.info("Added Minechem decomposer recipe for %s slab.", tree.getName());

            //noinspection ObjectAllocationInLoop
            final ItemStack sapling = new ItemStack(tree.getSaplingBlock(), 1, tree.getSaplingMeta());
            if (RecipeAPI.addDecompositionRecipe(sapling, "cellulose"))
                Logger.info("Added Minechem decomposer recipe for %s sapling.", tree.getName());

            //noinspection ObjectAllocationInLoop
            final ItemStack log = new ItemStack(tree.getLogBlock(), 1, tree.getLogMeta());
            if (RecipeAPI.addDecompositionRecipe(log, "8 cellulose"))
                Logger.info("Added Minechem decomposer recipe for %s wood.", tree.getName());

            //noinspection ObjectAllocationInLoop
            final ItemStack leaves = new ItemStack(tree.getLeavesBlock(), 1, tree.getLeavesMeta());
            if (RecipeAPI.addDecompositionRecipe(leaves, "4 cellulose"))
                Logger.info("Added Minechem decomposer recipe for %s wood.", tree.getName());
        }
    }
}

@@ -204,24 +204,68 @@
 mon.Loader;%0A
+import cpw.mods.fml.common.Optional.Method;%0A
 import minec
@@ -352,16 +352,71 @@
 %0A%7B%0A    ;
+%0A    private static final String MINECHEM = %22minechem%22;
 %0A%0A    pu
@@ -481,26 +481,24 @@
 dLoaded(
-%22minechem%22
+MINECHEM
 ))%0A     
@@ -623,16 +623,46 @@
 %0A    %7D%0A%0A
+    @Method(modid = MINECHEM)%0A
     priv

Remove runtime dependency on embedded API