Merge pull request #99 from CovertJaguar/patch-2
Added putting liquid in the tank from non-standard capacity containers.
This commit is contained in:
commit
6566cae096
1 changed files with 4 additions and 4 deletions
|
@ -93,12 +93,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, liquid.itemID, true);
|
||||
|
||||
if (qty != 0 && !BuildCraftCore.debugMode) {
|
||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,
|
||||
|
@ -111,7 +111,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;
|
||||
|
|
Loading…
Reference in a new issue