Fix Portable tank fluid setting bug

This commit is contained in:
Ben Spiers 2014-09-02 18:44:05 +01:00
parent c21404dd2d
commit 8f6b0ce6de

View file

@ -964,7 +964,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
if(MachineType.get(container) == MachineType.PORTABLE_TANK && resource != null) if(MachineType.get(container) == MachineType.PORTABLE_TANK && resource != null)
{ {
FluidStack stored = getFluidStack(container); FluidStack stored = getFluidStack(container);
int toFill = 0; int toFill;
if(stored != null && stored.getFluid() != resource.getFluid()) if(stored != null && stored.getFluid() != resource.getFluid())
{ {
@ -981,7 +981,8 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
if(doFill) if(doFill)
{ {
setFluidStack(new FluidStack(resource.getFluid(), toFill), container); int fillAmount = toFill + (stored == null ? 0 : stored.amount);
setFluidStack(new FluidStack(resource.getFluid(), fillAmount), container);
} }
return toFill; return toFill;