mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Final build for 1.4.7. *Cleaned up imports. *Added javadocs and cleaned up code. *API improvements and fixes. *Changed around packages and finalized API. *Fixed auto-download feature. *Removed UE implementation of multiblock, added my own. *Better Obsidian TNT code. *Better Atomic Assembler efficiency modes. *Made gas storage tanks more CPU efficient. *Better version control. *Added RecipeHelper for reflective implementations of recipes. *Reduced Osmium generation. *Fixed upgrade bug. *Pressurized Tube doesn't function when receiving a redstone signal. *Better Advanced Solar Generator code. *HP information for hoes. *Lowered chance of mobs spawning with armor. *InfuseRegistry for adding new infuse objects. *GasTransmission for external gas transmission.
105 lines
3.2 KiB
Java
105 lines
3.2 KiB
Java
package mekanism.api;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
public 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 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());
|
|
}
|
|
}
|
|
}
|