Merge pull request #1272 from rwtema/master

Fixed ItemFluidContainer always draining the maximum amount, regardless ...
This commit is contained in:
LexManos 2014-08-03 15:47:58 -07:00
commit dae471e7d7
1 changed files with 3 additions and 2 deletions

View File

@ -135,10 +135,11 @@ public class ItemFluidContainer extends Item implements IFluidContainerItem
return null;
}
int currentAmount = stack.amount;
stack.amount = Math.min(stack.amount, maxDrain);
if (doDrain)
{
if (maxDrain >= capacity)
if (currentAmount == stack.amount)
{
container.stackTagCompound.removeTag("Fluid");
@ -150,7 +151,7 @@ public class ItemFluidContainer extends Item implements IFluidContainerItem
}
NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid");
fluidTag.setInteger("Amount", fluidTag.getInteger("Amount") - maxDrain);
fluidTag.setInteger("Amount", currentAmount - stack.amount);
container.stackTagCompound.setTag("Fluid", fluidTag);
}
return stack;