Fix Portable tank fluid setting bug
This commit is contained in:
parent
c21404dd2d
commit
8f6b0ce6de
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue