Skip to content

Commit

Permalink
Fix Smelteries evaporating liquids when doing alloys at full capacity…
Browse files Browse the repository at this point in the history
…. Also small fix for fuel displays not working sometimes.
  • Loading branch information
bonii-xx committed Sep 16, 2014
1 parent da99630 commit 99cb5e8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java
Expand Up @@ -181,9 +181,7 @@ void adjustLayers (int lay, boolean forceAdjust)
}

// update current liquid. This is done in case some config or something changed the capacity or other things.
currentLiquid = 0;
for(FluidStack liquid : moltenMetal)
currentLiquid += liquid.amount;
updateCurrentLiquid();
}

/* Misc */
Expand Down Expand Up @@ -501,6 +499,9 @@ boolean addMoltenMetal (FluidStack liquid, boolean first)
}
else
{
// update liquid amount..
updateCurrentLiquid();

if (liquid.amount + currentLiquid > maxLiquid)
return false;

Expand Down Expand Up @@ -534,6 +535,12 @@ boolean addMoltenMetal (FluidStack liquid, boolean first)
}
}

private void updateCurrentLiquid() {
currentLiquid = 0;
for(FluidStack liquid : moltenMetal)
currentLiquid += liquid.amount;
}

private void updateTemperatures ()
{
inUse = true;
Expand Down Expand Up @@ -587,6 +594,8 @@ public void updateFuelDisplay ()

public void updateFuelGague ()
{
if(activeLavaTank == null)
activeLavaTank = lavaTanks.get(0);
if (activeLavaTank == null || useTime > 0)
return;

Expand Down Expand Up @@ -714,6 +723,7 @@ public void markDirty ()
{
updateTemperatures();
updateEntity();

super.markDirty();
needsUpdate = true;
// worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
Expand Down Expand Up @@ -1069,8 +1079,8 @@ public FluidStack drain (int maxDrain, boolean doDrain)
// liquid = null;
moltenMetal.remove(liquid);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
currentLiquid = 0;
needsUpdate = true;
updateCurrentLiquid();
}
return liq;
}
Expand Down

0 comments on commit 99cb5e8

Please sign in to comment.