The bug
When you start a furnace burning and then swap out what's in the fuel slot and save and quit, the next time you load the burn time indicator will glitch. The reason for this is that the NBT file for furnaces does not store the max fuel burn time and instead dynamically gets it from the fuel slot, which may no longer contain the same item as was used to initially fuel the furnace. This can be seen in the code snippet attached.
To reproduce
Start furnace burning with a fuel other than a stick.
Allow the burn time to visibly decrease.
Swap the fuel with something that burns shorter than the original fuel.
Save and quit.
Reload the save.
Open the furnace.
The burn time indicator will have increased.
With particularly large differences (lava bucket to stick), the progress bar may wrap around the top of the screen and display twice (see
[media]).
Fix
Rather than attempting to guess the total burn time of the original item, it should be saved too:
TileEntityFurnace
public void readFromNBT(NBTTagCompound compound)
{
super.readFromNBT(compound);
this.furnaceItemStacks = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
ItemStackHelper.loadAllItems(compound, this.furnaceItemStacks);
this.furnaceBurnTime = compound.getShort("BurnTime");
this.cookTime = compound.getShort("CookTime");
this.totalCookTime = compound.getShort("CookTimeTotal");
//this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks.get(1));
this.currentItemBurnTime = compound.getShort("BurnTimeTotal"); // added
if (compound.hasKey("CustomName", 8))
{
this.furnaceCustomName = compound.getString("CustomName");
}
}
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
super.writeToNBT(compound);
compound.setShort("BurnTime", (short)this.furnaceBurnTime);
compound.setShort("CookTime", (short)this.cookTime);
compound.setShort("CookTimeTotal", (short)this.totalCookTime);
compound.setShort("BurnTimeTotal", (short)this.currentItemBurnTime); // added
ItemStackHelper.saveAllItems(compound, this.furnaceItemStacks);
if (this.hasCustomName())
{
compound.setString("CustomName", this.furnaceCustomName);
}
return compound;
}
Linked issues
is duplicated by 29
relates to 4
Attachments
Comments 20
Confirmed in 13w07a. Just a visuall glitch with the burn time indicator, the burning process is correctly finished after smelting the amount of items according to the fuel type.
The fuel source does not need to be swapped, either. Simply unloading the chunk and loading it again is enough to trigger the glitch.
I first noticed it when I used lava buckets to start a bunch of furnaces and went to the Nether to refill the buckets. When I came back, this glitch had appeared.
Can confirm in 1.5.2 using lava buckets. Apparently, empty bucket or its removal is being treated as if you were swapping the fuel.

Confirmed for 1.6.1 and block of coal

Can confirm for 20w29a
Confirmed for 1.16.4

Does this also occur when switching dimensions or unloading and reloading the chunks in ways other than reloading the world?
Never mind, that's MC-137146.
Can confirm in 1.19.2.

The broken GUI is fixed in 23w32a, but the burn time indicator is still incorrect.
Unable to reproduce. Please provide a step by step list on how to reproduce. ie:
1. do this
2. now this
3. and finally this