mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Fixed ItemFluidContainer always draining the maximum amount, regardless of the amount remaining.
This commit is contained in:
1 parent
bc8374d71c
commit
eeb701cb16
1 file changed
+3
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user