From 18ba26eff29163d311b6483db6fcb85b78cc0f0e Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Sat, 14 Jul 2012 07:33:54 -0700 Subject: [PATCH] Added ability to put liquid in the tank from non-standard capacity containers. --- .../net/minecraft/src/buildcraft/factory/BlockTank.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/net/minecraft/src/buildcraft/factory/BlockTank.java b/common/net/minecraft/src/buildcraft/factory/BlockTank.java index 25779fbf..7de9df9a 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockTank.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockTank.java @@ -92,12 +92,12 @@ public class BlockTank extends BlockContainer implements ITextureProvider { ItemStack current = entityplayer.inventory.getCurrentItem(); if (current != null) { - int liquidId = LiquidManager.getLiquidIDForFilledItem(current); + LiquidStack liquid = LiquidManager.getLiquidForFilledItem(current); TileTank tank = (TileTank) world.getBlockTileEntity(i, j, k); - if (liquidId != 0) { - int qty = tank.fill(Orientations.Unknown, BuildCraftAPI.BUCKET_VOLUME, liquidId, true); + if (liquid != null) { + int qty = tank.fill(Orientations.Unknown, liquid.amount, liquidId, true); if (qty != 0 && !BuildCraftCore.debugMode) { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, @@ -110,7 +110,7 @@ public class BlockTank extends BlockContainer implements ITextureProvider { int qty = tank.empty(BuildCraftAPI.BUCKET_VOLUME, false); - LiquidStack liquid = LiquidManager.getLiquidForFilledItem(filled); + liquid = LiquidManager.getLiquidForFilledItem(filled); if(liquid != null && qty >= liquid.amount){ if(current.stackSize > 1 && !entityplayer.inventory.addItemStackToInventory(filled)){ return false;