From bc183d661e3366a3698f72979ee7f0fdca2dc9d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 23 Jun 2016 20:44:20 +0200 Subject: [PATCH] Alloy furnace - Slag when breaking during alloying --- src/java/mmm/tech/base/TBAlloyFurnaceBlock.java | 1 + .../mmm/tech/base/TBAlloyFurnaceTileEntity.java | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java b/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java index 44504b7..3df26f4 100644 --- a/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java +++ b/src/java/mmm/tech/base/TBAlloyFurnaceBlock.java @@ -315,6 +315,7 @@ public class TBAlloyFurnaceBlock if ( tileEntity instanceof TBAlloyFurnaceTileEntity ) { final TBAlloyFurnaceTileEntity afte = (TBAlloyFurnaceTileEntity) tileEntity; + afte.cancelAlloying( ); InventoryHelper.dropInventoryItems( worldIn , pos , afte.input ); InventoryHelper.dropInventoryItems( worldIn , pos , afte.fuel ); InventoryHelper.dropInventoryItems( worldIn , pos , afte.output ); diff --git a/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java b/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java index 4e2e21c..c7e8abf 100644 --- a/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java +++ b/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java @@ -127,9 +127,8 @@ public class TBAlloyFurnaceTileEntity if ( this.burnCurrent == 0 ) { if ( this.alloying != null ) { if ( !this.startBurning( this.alloyCurrent ) ) { - this.addOutput( new ItemStack( Materials.ITEM_SLAG , this.alloying.getTotalInputItems( ) ) ); - this.alloying = null; - this.alloyCurrent = this.burnCurrent = this.burnTotal = 0; + cancelAlloying( ); + this.burnCurrent = this.burnTotal = 0; } } else { this.burnTotal = this.burnCurrent = 0; @@ -153,6 +152,16 @@ public class TBAlloyFurnaceTileEntity } + public void cancelAlloying( ) + { + if ( this.alloying != null ) { + this.addOutput( new ItemStack( Materials.ITEM_SLAG , this.alloying.getTotalInputItems( ) ) ); + this.alloying = null; + this.alloyCurrent = 0; + } + } + + public void setRecipe( final ResourceLocation location ) { MAlloyRecipe recipe = MAlloyRecipe.REGISTRY.getRecipe( location );