Moved blast furnace recipes over to new crafter still needs to get heat
This commit is contained in:
parent
37467cab7e
commit
ddb4b5cb20
8 changed files with 198 additions and 346 deletions
|
@ -1,58 +0,0 @@
|
|||
package techreborn.api;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BlastFurnaceRecipe {
|
||||
ItemStack input1, input2;
|
||||
ItemStack output1, output2;
|
||||
int tickTime;
|
||||
int minHeat;
|
||||
|
||||
public BlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2,int tickTime, int minHeat) {
|
||||
this.input1 = input1;
|
||||
this.input2 = input2;
|
||||
this.output1 = output1;
|
||||
this.output2 = output2;
|
||||
this.tickTime = tickTime;
|
||||
this.minHeat = minHeat;
|
||||
}
|
||||
|
||||
public BlastFurnaceRecipe(Item input1, Item input2, int inputAmount, Item output1, net.minecraft.item.Item output2, int tickTime, int minHeat) {
|
||||
if(input1 != null)
|
||||
this.input1 = new ItemStack(input1, inputAmount);
|
||||
if(input2 != null)
|
||||
this.input2 = new ItemStack(input1, inputAmount);
|
||||
if (output1 != null)
|
||||
this.output1 = new ItemStack(output1);
|
||||
if (output2 != null)
|
||||
this.output2 = new ItemStack(output2);
|
||||
this.tickTime = tickTime;
|
||||
this.minHeat = minHeat;
|
||||
}
|
||||
|
||||
public ItemStack getInput1() {
|
||||
return input1;
|
||||
}
|
||||
|
||||
public ItemStack getInput2() {
|
||||
return input2;
|
||||
}
|
||||
|
||||
public ItemStack getOutput1() {
|
||||
return output1;
|
||||
}
|
||||
|
||||
public ItemStack getOutput2() {
|
||||
return output2;
|
||||
}
|
||||
|
||||
public int getTickTime() {
|
||||
return tickTime;
|
||||
}
|
||||
|
||||
public int getMinHeat() {
|
||||
return minHeat;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,36 +6,7 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.util.ItemUtils;
|
||||
|
||||
public final class TechRebornAPI {
|
||||
|
||||
public static ArrayList<BlastFurnaceRecipe> blastFurnaceRecipes = new ArrayList<BlastFurnaceRecipe>();
|
||||
|
||||
public static void registerBlastFurnaceRecipe(BlastFurnaceRecipe recipie) {
|
||||
boolean shouldAdd = true;
|
||||
for (BlastFurnaceRecipe blastFurnaceRecipe : blastFurnaceRecipes) {
|
||||
if (ItemUtils.isItemEqual(blastFurnaceRecipe.getInput1(), recipie.getInput1(), false, true) && ItemUtils.isItemEqual(blastFurnaceRecipe.getInput2(), recipie.getInput2(), false, true)) {
|
||||
{
|
||||
try {
|
||||
throw new RegisteredItemRecipe(
|
||||
"Item "
|
||||
+ recipie.getInput1()
|
||||
.getUnlocalizedName()
|
||||
+ " and " + recipie.getInput2().getUnlocalizedName() + " is already being used in a recipe for the BlastFurnace");
|
||||
} catch (RegisteredItemRecipe registeredItemRecipe) {
|
||||
registeredItemRecipe.printStackTrace();
|
||||
shouldAdd = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shouldAdd){
|
||||
blastFurnaceRecipes.add(recipie);
|
||||
//This adds the same recipe but backwards. so you can swap the inputs
|
||||
blastFurnaceRecipes.add(new BlastFurnaceRecipe(recipie.getInput2(), recipie.getInput1(), recipie.output1, recipie.output2, recipie.tickTime, recipie.minHeat));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void addRollingMachinceRecipe(ItemStack output,
|
||||
Object... components)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class BlastFurnaceRecipe extends BaseRecipe {
|
||||
|
||||
public BlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1 , ItemStack output2, int tickTime, int euPerTick) {
|
||||
super("blastFurnaceRecipe", tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
inputs.add(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue