Fix a few things, start on recipes
This commit is contained in:
parent
398dffb7ce
commit
0aafa16106
3 changed files with 48 additions and 14 deletions
|
@ -22,7 +22,7 @@ public final class RecipeHelper
|
|||
public static void addEnrichmentChamberRecipe(ItemStack input, ItemStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addEnrichmentChamberRecipe", ItemStack.class, ItemStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -38,7 +38,7 @@ public final class RecipeHelper
|
|||
public static void addOsmiumCompressorRecipe(ItemStack input, ItemStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addOsmiumCompressorRecipe", ItemStack.class, ItemStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -54,7 +54,7 @@ public final class RecipeHelper
|
|||
public static void addCombinerRecipe(ItemStack input, ItemStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addCombinerRecipe", ItemStack.class, ItemStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -70,7 +70,7 @@ public final class RecipeHelper
|
|||
public static void addCrusherRecipe(ItemStack input, ItemStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addCrusherRecipe", ItemStack.class, ItemStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -86,7 +86,7 @@ public final class RecipeHelper
|
|||
public static void addPurificationChamberRecipe(ItemStack input, ItemStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addPurificationChamberRecipe", ItemStack.class, ItemStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -102,7 +102,7 @@ public final class RecipeHelper
|
|||
public static void addChemicalOxidizerRecipe(ItemStack input, GasStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addChemicalOxidizerRecipe", ItemStack.class, GasStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -118,7 +118,7 @@ public final class RecipeHelper
|
|||
public static void addChemicalInfuserRecipe(ChemicalPair input, GasStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addChemicalInfuserRecipe", ChemicalPair.class, GasStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -126,6 +126,22 @@ public final class RecipeHelper
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Precision Sawmill recipe.
|
||||
* @param input - input ItemStack
|
||||
* @param output - output ChanceOutput
|
||||
*/
|
||||
public static void addPrecisionSawmillRecipe(ItemStack input, ChanceOutput output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addPrecisionSawmillRecipe", ItemStack.class, ChanceOutput.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
|
||||
|
@ -134,7 +150,7 @@ public final class RecipeHelper
|
|||
public static void addChemicalInjectionChamberRecipe(ItemStack input, ItemStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addChemicalInjectionChamberRecipe", ItemStack.class, ItemStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -150,7 +166,7 @@ public final class RecipeHelper
|
|||
public static void addElectrolyticSeparatorRecipe(FluidStack input, ChemicalPair output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addElectrolyticSeparatorRecipe", FluidStack.class, ChemicalPair.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
@ -166,7 +182,7 @@ public final class RecipeHelper
|
|||
public static void addMetallurgicInfuserRecipe(InfusionInput input, ItemStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addMetallurgicInfuserRecipe", InfusionInput.class, ItemStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public abstract class ChanceMachineRecipeHandler extends TemplateRecipeHandler
|
|||
|
||||
if(recipe.output.hasSecondary())
|
||||
{
|
||||
drawString(Math.round(recipe.output.secondaryChance*100) + "%", 116, 52, 0x404040);
|
||||
drawString(Math.round(recipe.output.secondaryChance*100) + "%", 116, 52, 0x404040, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,16 +119,26 @@ public abstract class ChanceMachineRecipeHandler extends TemplateRecipeHandler
|
|||
|
||||
@Override
|
||||
public PositionedStack getResult()
|
||||
{
|
||||
if(output.hasPrimary())
|
||||
{
|
||||
return new PositionedStack(output.primaryOutput, 100, 30);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getOtherStack()
|
||||
{
|
||||
if(output.hasSecondary())
|
||||
{
|
||||
return new PositionedStack(output.secondaryOutput, 116, 30);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public CachedIORecipe(ItemStack itemstack, ChanceOutput chance)
|
||||
{
|
||||
input = new PositionedStack(itemstack, 40, 12);
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import mekanism.api.ChanceOutput;
|
||||
import mekanism.api.ChemicalPair;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
|
@ -643,6 +644,13 @@ public class Mekanism
|
|||
RecipeHandler.addChemicalInjectionChamberRecipe(new ItemStack(Block.obsidian), new ItemStack(Shard, 3, 6));
|
||||
RecipeHandler.addChemicalInjectionChamberRecipe(new ItemStack(Item.gunpowder), new ItemStack(Dust, 1, 10));
|
||||
|
||||
//Precision Sawmill Recipes
|
||||
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Block.ladder, 3), new ChanceOutput(new ItemStack(Item.stick, 7)));
|
||||
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Block.chest), new ChanceOutput(new ItemStack(Block.planks, 8)));
|
||||
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Block.trapdoor), new ChanceOutput(new ItemStack(Block.planks, 3)));
|
||||
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Item.boat), new ChanceOutput(new ItemStack(Block.planks, 5)));
|
||||
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Item.bed), new ChanceOutput(new ItemStack(Block.planks, 3), new ItemStack(Block.cloth, 3), 1));
|
||||
|
||||
//Metallurgic Infuser Recipes
|
||||
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("CARBON"), 10, new ItemStack(Item.ingotIron)), new ItemStack(EnrichedIron));
|
||||
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("CARBON"), 10, new ItemStack(EnrichedIron)), new ItemStack(Dust, 1, 5));
|
||||
|
|
Loading…
Reference in a new issue