diff --git a/src/main/java/techreborn/compat/nei/recipes/IronAlloySmelterRecipeHandler.java b/src/main/java/techreborn/compat/nei/recipes/IronAlloySmelterRecipeHandler.java index 38b01604e..ab014202e 100644 --- a/src/main/java/techreborn/compat/nei/recipes/IronAlloySmelterRecipeHandler.java +++ b/src/main/java/techreborn/compat/nei/recipes/IronAlloySmelterRecipeHandler.java @@ -53,7 +53,7 @@ public class IronAlloySmelterRecipeHandler extends GenericRecipeHander implement @Override public String getRecipeName() { - return Reference.ironalloySmelteRecipe; + return Reference.alloySmelteRecipe; } @Override diff --git a/src/main/java/techreborn/lib/Reference.java b/src/main/java/techreborn/lib/Reference.java index f7557325a..652599f9f 100644 --- a/src/main/java/techreborn/lib/Reference.java +++ b/src/main/java/techreborn/lib/Reference.java @@ -4,7 +4,6 @@ import net.minecraft.util.StatCollector; public class Reference { public static String alloySmelteRecipe = StatCollector.translateToLocal("techreborn.recipe.alloysmelter"); - public static String ironalloySmelteRecipe = StatCollector.translateToLocal("techreborn.recipe.ironalloysmelter"); public static String assemblingMachineRecipe = StatCollector.translateToLocal("techreborn.recipe.assemblingmachine"); public static String blastFurnaceRecipe = StatCollector.translateToLocal("techreborn.recipe.blastfurnace"); public static String centrifugeRecipe = StatCollector.translateToLocal("techreborn.recipe.centrifuge"); diff --git a/src/main/java/techreborn/tiles/TileAlloyFurnace.java b/src/main/java/techreborn/tiles/TileAlloyFurnace.java index 321afe4f9..a3dc4ea06 100644 --- a/src/main/java/techreborn/tiles/TileAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/TileAlloyFurnace.java @@ -42,31 +42,24 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II @Override public void updateEntity() { super.updateEntity(); - boolean flag = this.burnTime > 0; boolean flag1 = false; - if (this.burnTime > 0) { --this.burnTime; } - if (!this.worldObj.isRemote) { if (this.burnTime != 0 || getStackInSlot(input1) != null && getStackInSlot(fuel) != null) { if (this.burnTime == 0 && this.canSmelt()) { this.currentItemBurnTime = this.burnTime = getItemBurnTime(getStackInSlot(fuel)); - if (this.burnTime > 0) { flag1 = true; - if (this.getStackInSlot(fuel) != null) { decrStackSize(fuel, 1); } } } - if (this.isBurning() && this.canSmelt()) { ++this.cookTime; - if (this.cookTime == 200) { this.cookTime = 0; this.smeltItem(); @@ -76,17 +69,14 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II this.cookTime = 0; } } - if (flag != this.burnTime > 0) { flag1 = true; //TODO sync on/off } } - if (flag1) { this.markDirty(); } - } public boolean hasAllInputs(IBaseRecipeType recipeType) { @@ -151,18 +141,26 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II } for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) { + boolean hasAllRecipes = true; for (ItemStack input : recipeType.getInputs()) { - if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true)) { - this.decrStackSize(input1, input.stackSize); - } else if (ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) { - this.decrStackSize(input2, input.stackSize); + if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true) || ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) { + + } else { + hasAllRecipes = false; + } + } + if(hasAllRecipes){ + for (ItemStack input : recipeType.getInputs()) { + for (int inputSlot = 0; inputSlot < 2; inputSlot++) { + if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, recipeType.useOreDic())) { + inventory.decrStackSize(inputSlot, input.stackSize); + break; + } + } } } } - this.decrStackSize(input1, 1); - - } }