From 8001cb13a2aad81005419c4057a56ecdf19a2064 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= <tseeker@nocternity.net>
Date: Sat, 25 Jun 2016 20:55:11 +0200
Subject: [PATCH] Alloy furnace - Fixed various issues

+ Bad read for current alloy recipe
+ Incorrect handling of burn / alloy update
---
 .../mmm/tech/base/TBAlloyFurnaceTileEntity.java     | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java b/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java
index d33868c..88c8764 100644
--- a/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java
+++ b/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java
@@ -129,11 +129,7 @@ public class TBAlloyFurnaceTileEntity
 					if ( this.alloying.slag != 0 ) {
 						this.addOutput( new ItemStack( Materials.ITEM_SLAG , this.alloying.slag ) );
 					}
-					if ( this.canAlloy( ) ) {
-						this.startAlloying( );
-					} else {
-						this.alloying = null;
-					}
+					this.alloying = null;
 				}
 			}
 
@@ -148,7 +144,10 @@ public class TBAlloyFurnaceTileEntity
 				}
 			}
 
-		} else if ( this.canAlloy( ) && this.startBurning( this.recipe.burnTime ) ) {
+		}
+
+		if ( !this.isAlloying( ) && this.canAlloy( )
+				&& ( this.isBurning( ) || this.startBurning( this.recipe.burnTime ) ) ) {
 			this.startAlloying( );
 			dirty = true;
 		}
@@ -423,7 +422,7 @@ public class TBAlloyFurnaceTileEntity
 		if ( "".equals( alloyingRecipeName ) ) {
 			this.alloying = null;
 		} else {
-			this.alloying = MAlloyRecipe.REGISTRY.getRecipe( new ResourceLocation( recipeName ) );
+			this.alloying = MAlloyRecipe.REGISTRY.getRecipe( new ResourceLocation( alloyingRecipeName ) );
 		}
 		if ( this.alloying == null ) {
 			this.alloyCurrent = 0;