Changed the AlloySmelter recipe handler to new system

This commit is contained in:
Gig 2015-05-07 23:11:34 +01:00
parent f075d6391c
commit e01058fca6
4 changed files with 28 additions and 67 deletions

View file

@ -1,45 +0,0 @@
package techreborn.api;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class AlloySmelterRecipe {
ItemStack input1, input2;
ItemStack output1;
int tickTime;
int minHeat;
public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1 ,int tickTime) {
this.input1 = input1;
this.input2 = input2;
this.output1 = output1;
this.tickTime = tickTime;
}
public AlloySmelterRecipe(Item input1, Item input2, int inputAmount, Item output1, int tickTime) {
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);
this.tickTime = tickTime;
}
public ItemStack getInput1() {
return input1;
}
public ItemStack getInput2() {
return input2;
}
public ItemStack getOutput1() {
return output1;
}
public int getTickTime() {
return tickTime;
}
}

View file

@ -9,7 +9,6 @@ public final class TechRebornAPI {
public static ArrayList<CentrifugeRecipie> centrifugeRecipies = new ArrayList<CentrifugeRecipie>();
public static ArrayList<BlastFurnaceRecipe> blastFurnaceRecipes = new ArrayList<BlastFurnaceRecipe>();
public static ArrayList<AlloySmelterRecipe> alloySmelterRecipes = new ArrayList<AlloySmelterRecipe>();
public static void registerCentrifugeRecipe(CentrifugeRecipie recipie)
@ -64,26 +63,6 @@ public final class TechRebornAPI {
}
public static void registerAlloySmelterRecipe(AlloySmelterRecipe recipie) {
boolean shouldAdd = true;
for (AlloySmelterRecipe alloySmelterRecipe : alloySmelterRecipes) {
if (ItemUtils.isItemEqual(alloySmelterRecipe.getInput1(), recipie.getInput1(), false, true) && ItemUtils.isItemEqual(alloySmelterRecipe.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 Alloy Smelter");
} catch (RegisteredItemRecipe registeredItemRecipe) {
registeredItemRecipe.printStackTrace();
shouldAdd = false;
}
}
}
}
}
public static void addRollingMachinceRecipe(ItemStack output,
Object... components)