From e03734e66d0cb03ae23540325541f2879c6809ea Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 20 Feb 2019 19:39:23 +0000 Subject: [PATCH] Fix #1669 --- .../tiles/tier0/TileIronAlloyFurnace.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java index 7c2aaec85..226423b0f 100644 --- a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java @@ -24,6 +24,7 @@ package techreborn.tiles.tier0; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.*; import net.minecraft.tileentity.TileEntityFurnace; @@ -31,6 +32,7 @@ import reborncore.api.IToolDrop; import reborncore.api.recipe.IBaseRecipeType; import reborncore.api.recipe.RecipeHandler; import reborncore.api.tile.IInventoryProvider; +import reborncore.common.blocks.BlockMachineBase; import reborncore.common.recipes.RecipeTranslator; import reborncore.common.registration.RebornRegistry; import reborncore.common.tile.TileLegacyMachineBase; @@ -220,14 +222,19 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase } } if (isBurning() && canSmelt()) { + if(!isActive()){ + setActive(true); + } ++cookTime; if (cookTime == 200) { cookTime = 0; smeltItem(); updateInventory = true; + setActive(false); } } else { cookTime = 0; + setActive(false); } } if (burning != isBurning()) { @@ -237,7 +244,14 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase markDirty(); } } - + + public void setActive(boolean active) { + Block block = world.getBlockState(pos).getBlock(); + if (block instanceof BlockMachineBase) { + world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, active)); + } + } + @Override public boolean canBeUpgraded() { return false;