2013-03-11 18:49:01 +01:00
|
|
|
package mekanism.api;
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
2013-12-13 02:35:37 +01:00
|
|
|
import mekanism.api.gas.GasStack;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.api.infuse.InfusionInput;
|
2013-03-11 18:49:01 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-01-05 22:27:56 +01:00
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
2013-03-11 18:49:01 +01:00
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-13 02:35:37 +01:00
|
|
|
/**
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
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!
2013-12-31 21:07:09 +01:00
|
|
|
* Add a Chemical Oxidizer recipe.
|
2013-12-13 02:35:37 +01:00
|
|
|
* @param input - input ItemStack
|
|
|
|
* @param output - output GasStack
|
|
|
|
*/
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
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!
2013-12-31 21:07:09 +01:00
|
|
|
public static void addChemicalOxidizerRecipe(ItemStack input, GasStack output)
|
2013-12-13 02:35:37 +01:00
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
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!
2013-12-31 21:07:09 +01:00
|
|
|
Method m = recipeClass.getMethod("addChemicalOxidizerRecipe", ItemStack.class, GasStack.class);
|
2013-12-13 02:35:37 +01:00
|
|
|
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
|
|
|
|
*/
|
2014-01-10 18:58:05 +01:00
|
|
|
public static void addChemicalInfuserRecipe(ChemicalPair input, GasStack output)
|
2013-12-13 02:35:37 +01:00
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
2014-01-10 18:58:05 +01:00
|
|
|
Method m = recipeClass.getMethod("addChemicalInfuserRecipe", ChemicalPair.class, GasStack.class);
|
2013-12-13 02:35:37 +01:00
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-24 06:23:30 +01:00
|
|
|
/**
|
|
|
|
* 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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-05 22:27:56 +01:00
|
|
|
/**
|
|
|
|
* Add a Electrolytic Separator recipe.
|
|
|
|
* @param input - input ItemStack
|
|
|
|
* @param output - output ItemStack
|
|
|
|
*/
|
2014-01-10 18:58:05 +01:00
|
|
|
public static void addElectrolyticSeparatorRecipe(FluidStack input, ChemicalPair output)
|
2014-01-05 22:27:56 +01:00
|
|
|
{
|
|
|
|
try {
|
|
|
|
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
2014-01-10 18:58:05 +01:00
|
|
|
Method m = recipeClass.getMethod("addElectrolyticSeparatorRecipe", FluidStack.class, ChemicalPair.class);
|
2014-01-05 22:27:56 +01:00
|
|
|
m.invoke(null, input, output);
|
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-11 18:49:01 +01:00
|
|
|
/**
|
|
|
|
* 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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|