2013-03-11 18:49:01 +01:00
|
|
|
package mekanism.api;
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
2013-04-01 01:12:10 +02:00
|
|
|
/**
|
|
|
|
* Use this handy class to add recipes to Mekanism machinery.
|
|
|
|
* @author AidanBrady
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public final class RecipeHelper
|
2013-03-11 18:49:01 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Add an Enrichment Chamber recipe.
|
|
|
|
* @param input - input ItemStack
|
|
|
|
* @param output - output ItemStack
|
|
|
|
*/
|
|
|
|
public static void addEnrichmentChamberRecipe(ItemStack input, ItemStack output)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
|
|
Method m = recipeClass.getMethod("addEnrichmentChamberRecipe", ItemStack.class, ItemStack.class);
|
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an Osmium Compressor recipe.
|
|
|
|
* @param input - input ItemStack
|
|
|
|
* @param output - output ItemStack
|
|
|
|
*/
|
|
|
|
public static void addOsmiumCompressorRecipe(ItemStack input, ItemStack output)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
|
|
Method m = recipeClass.getMethod("addOsmiumCompressorRecipe", ItemStack.class, ItemStack.class);
|
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a Combiner recipe.
|
|
|
|
* @param input - input ItemStack
|
|
|
|
* @param output - output ItemStack
|
|
|
|
*/
|
|
|
|
public static void addCombinerRecipe(ItemStack input, ItemStack output)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
|
|
Method m = recipeClass.getMethod("addCombinerRecipe", ItemStack.class, ItemStack.class);
|
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a Crusher recipe.
|
|
|
|
* @param input - input ItemStack
|
|
|
|
* @param output - output ItemStack
|
|
|
|
*/
|
|
|
|
public static void addCrusherRecipe(ItemStack input, ItemStack output)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
|
|
Method m = recipeClass.getMethod("addCrusherRecipe", ItemStack.class, ItemStack.class);
|
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a Purification Chamber recipe.
|
|
|
|
* @param input - input ItemStack
|
|
|
|
* @param output - output ItemStack
|
|
|
|
*/
|
|
|
|
public static void addPurificationChamberRecipe(ItemStack input, ItemStack output)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
|
|
Method m = recipeClass.getMethod("addPurificationChamberRecipe", ItemStack.class, ItemStack.class);
|
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a Metallurgic Infuser recipe.
|
|
|
|
* @param input - input Infusion
|
|
|
|
* @param output - output ItemStack
|
|
|
|
*/
|
|
|
|
public static void addMetallurgicInfuserRecipe(InfusionInput input, ItemStack output)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
|
|
Method m = recipeClass.getMethod("addMetallurgicInfuserRecipe", InfusionInput.class, ItemStack.class);
|
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|