diff --git a/src/main/java/techreborn/api/AlloySmelterRecipe.java b/src/main/java/techreborn/api/AlloySmelterRecipe.java deleted file mode 100644 index 92de35626..000000000 --- a/src/main/java/techreborn/api/AlloySmelterRecipe.java +++ /dev/null @@ -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; - } -} - diff --git a/src/main/java/techreborn/api/TechRebornAPI.java b/src/main/java/techreborn/api/TechRebornAPI.java index ef528c378..27f36dcdd 100644 --- a/src/main/java/techreborn/api/TechRebornAPI.java +++ b/src/main/java/techreborn/api/TechRebornAPI.java @@ -9,7 +9,6 @@ public final class TechRebornAPI { public static ArrayList centrifugeRecipies = new ArrayList(); public static ArrayList blastFurnaceRecipes = new ArrayList(); - public static ArrayList alloySmelterRecipes = new ArrayList(); 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) diff --git a/src/main/java/techreborn/recipes/AlloySmelterRecipe.java b/src/main/java/techreborn/recipes/AlloySmelterRecipe.java new file mode 100644 index 000000000..9ead92f7d --- /dev/null +++ b/src/main/java/techreborn/recipes/AlloySmelterRecipe.java @@ -0,0 +1,18 @@ +package techreborn.recipes; + +import net.minecraft.item.ItemStack; +import techreborn.api.recipe.BaseRecipe; + +public class AlloySmelterRecipe extends BaseRecipe { + + public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) + { + super("alloySmelterRecipe", tickTime, euPerTick); + if(input1 != null) + inputs.add(input1); + if(input2 != null) + inputs.add(input2); + if(output1 != null) + outputs.add(output1); + } +} diff --git a/src/main/java/techreborn/tiles/TileAlloySmelter.java b/src/main/java/techreborn/tiles/TileAlloySmelter.java index 8a228daea..8a92d9ad2 100644 --- a/src/main/java/techreborn/tiles/TileAlloySmelter.java +++ b/src/main/java/techreborn/tiles/TileAlloySmelter.java @@ -4,6 +4,7 @@ import ic2.api.energy.prefab.BasicSink; import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import techreborn.api.recipe.RecipeCrafter; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.util.Inventory; @@ -13,11 +14,19 @@ public class TileAlloySmelter extends TileMachineBase implements IWrenchable { public int tickTime; public BasicSink energy; public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64); + public RecipeCrafter crafter; public TileAlloySmelter() { //TODO configs energy = new BasicSink(this, 1000, 2); + //Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[1]; + outputs[0] = 2; + crafter = new RecipeCrafter("alloySmelterRecipe", this, energy, 2, 2, inventory, inputs, outputs); } @Override @@ -25,8 +34,8 @@ public class TileAlloySmelter extends TileMachineBase implements IWrenchable { { super.updateEntity(); energy.updateEntity(); + crafter.updateEntity(); } - @Override public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)