mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-17 10:55:06 +00:00
Fix #1009 Minor fluid dupe on right-clicking nearly-full machine
This commit is contained in:
1 parent
e2f32ab767
commit
c2437a8a13
1 file changed
+11
-3
@@ -49,11 +49,19 @@ public final class FluidHelper {
|
||||
FluidStack liquid = getFluidStackInContainer(current);
|
||||
|
||||
if (fill && liquid != null) {
|
||||
int used = tank.fill(side, liquid, true);
|
||||
int canUseAmount = tank.fill(side, liquid, false);
|
||||
if (canUseAmount == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (used > 0) {
|
||||
ItemStack drainedContainer = getDrainedContainer(current, canUseAmount);
|
||||
if (ItemStackUtil.isIdenticalItem(current, drainedContainer)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int usedAmount = tank.fill(side, liquid, true);
|
||||
if (usedAmount > 0) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
ItemStack drainedContainer = getDrainedContainer(current, used);
|
||||
if (current.stackSize > 1) {
|
||||
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
if (drainedContainer != null && !player.inventory.addItemStackToInventory(drainedContainer)) {
|
||||
|
||||
Reference in new issue
Block a user