Merge pull request #1272 from rwtema/master
Fixed ItemFluidContainer always draining the maximum amount, regardless ...
This commit is contained in:
commit
dae471e7d7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue