Fix electric furnace not always turning off

This commit is contained in:
modmuss50 2019-08-18 15:31:21 +01:00
parent 926063ffcf
commit 7f8bd2ab1f

View file

@ -127,6 +127,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
currentRecipe = null; currentRecipe = null;
cookTime = 0; cookTime = 0;
cookTimeTotal = 0; cookTimeTotal = 0;
updateState();
} }
private void updateState() { private void updateState() {
@ -134,7 +135,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
if (furnaceBlock instanceof BlockMachineBase) { if (furnaceBlock instanceof BlockMachineBase) {
BlockMachineBase blockMachineBase = (BlockMachineBase) furnaceBlock; BlockMachineBase blockMachineBase = (BlockMachineBase) furnaceBlock;
boolean isActive = isActive() || canCraftAgain(); boolean isActive = currentRecipe != null || canCraftAgain();
blockMachineBase.setActive(isActive, world, pos); blockMachineBase.setActive(isActive, world, pos);
} }
world.updateListeners(pos, world.getBlockState(pos), world.getBlockState(pos), 3); world.updateListeners(pos, world.getBlockState(pos), world.getBlockState(pos), 3);
@ -220,7 +221,6 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
} }
if (currentRecipe != null && (!hasAllInputs(currentRecipe) || !canAcceptOutput(currentRecipe, outputSlot))) { if (currentRecipe != null && (!hasAllInputs(currentRecipe) || !canAcceptOutput(currentRecipe, outputSlot))) {
resetCrafter(); resetCrafter();
updateState();
} }
} }