From 8f6b0ce6debd6e80ad822608dbecd08fa3b369a1 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Tue, 2 Sep 2014 18:44:05 +0100 Subject: [PATCH] Fix Portable tank fluid setting bug --- src/main/java/mekanism/common/item/ItemBlockMachine.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/mekanism/common/item/ItemBlockMachine.java b/src/main/java/mekanism/common/item/ItemBlockMachine.java index e514244bd..791d548d1 100644 --- a/src/main/java/mekanism/common/item/ItemBlockMachine.java +++ b/src/main/java/mekanism/common/item/ItemBlockMachine.java @@ -964,8 +964,8 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec if(MachineType.get(container) == MachineType.PORTABLE_TANK && resource != null) { FluidStack stored = getFluidStack(container); - int toFill = 0; - + int toFill; + if(stored != null && stored.getFluid() != resource.getFluid()) { return 0; @@ -981,7 +981,8 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec 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;