Merge pull request #98 from CovertJaguar/patch-1

Added support for non-standard capacity liquid container filling.
This commit is contained in:
SirSengir 2012-07-14 06:56:57 -07:00
commit 29b074acf5

View file

@ -110,13 +110,14 @@ public class BlockTank extends BlockContainer implements ITextureProvider {
int qty = tank.empty(BuildCraftAPI.BUCKET_VOLUME, false); int qty = tank.empty(BuildCraftAPI.BUCKET_VOLUME, false);
if(filled != null && qty >= BuildCraftAPI.BUCKET_VOLUME){ LiquidStack liquid = LiquidManager.getLiquidForFilledItem(filled);
if(liquid != null && qty >= liquid.amount){
if(current.stackSize > 1 && !entityplayer.inventory.addItemStackToInventory(filled)){ if(current.stackSize > 1 && !entityplayer.inventory.addItemStackToInventory(filled)){
return false; return false;
} }
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,
Utils.consumeItem(current)); Utils.consumeItem(current));
tank.empty(BuildCraftAPI.BUCKET_VOLUME, true); tank.empty(liquid.amount, true);
return true; return true;
} }
} }