750bb2dab7
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
159 lines
5 KiB
Java
159 lines
5 KiB
Java
package mekanism.api;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import mekanism.api.gas.GasStack;
|
|
import mekanism.api.infuse.InfusionInput;
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
/**
|
|
* Use this handy class to add recipes to Mekanism machinery.
|
|
* @author AidanBrady
|
|
*
|
|
*/
|
|
public final class RecipeHelper
|
|
{
|
|
/**
|
|
* 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 Chemical Oxidizer recipe.
|
|
* @param input - input ItemStack
|
|
* @param output - output GasStack
|
|
*/
|
|
public static void addChemicalOxidizerRecipe(ItemStack input, GasStack output)
|
|
{
|
|
try {
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
Method m = recipeClass.getMethod("addChemicalOxidizerRecipe", ItemStack.class, GasStack.class);
|
|
m.invoke(null, input, output);
|
|
} catch(Exception e) {
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Add a Chemical Infuser recipe.
|
|
* @param input - input ChemicalInput
|
|
* @param output - output GasStack
|
|
*/
|
|
public static void addChemicalInfuserRecipe(ChemicalInput input, GasStack output)
|
|
{
|
|
try {
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
Method m = recipeClass.getMethod("addChemicalInfuserRecipe", ChemicalInput.class, GasStack.class);
|
|
m.invoke(null, input, output);
|
|
} catch(Exception e) {
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Add a Chemical Injection Chamber recipe.
|
|
* @param input - input ItemStack
|
|
* @param output - output ItemStack
|
|
*/
|
|
public static void addChemicalInjectionChamberRecipe(ItemStack input, ItemStack output)
|
|
{
|
|
try {
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
|
Method m = recipeClass.getMethod("addChemicalInjectionChamberRecipe", 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());
|
|
}
|
|
}
|
|
}
|