Program: 95754
Project: 95754
Buggy source:
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int side,float fX,float fY,float fZ){
  boolean update=false;
  if (!world.isRemote) {
    TileEntityTank tank=(TileEntityTank)world.getTileEntity(x,y,z);
    ItemStack stack=player.getCurrentEquippedItem();
    if (stack != null && stack.getItem() != null) {
      FluidStack liquid=FluidContainerRegistry.getFluidForFilledItem(stack);
      if (liquid != null && liquid.getFluid() == FluidRegistry.WATER) {
        int quantity=tank.fill(ForgeDirection.UNKNOWN,liquid,false);
        if (quantity == liquid.amount) {
          tank.fill(ForgeDirection.UNKNOWN,liquid,true);
          update=true;
          if (!player.capabilities.isCreativeMode) {
            if (stack.stackSize == 1) {
              if (stack.getItem().hasContainerItem(stack)) {
                player.inventory.setInventorySlotContents(player.inventory.currentItem,stack.getItem().getContainerItem(stack));
              }
 else {
                player.inventory.setInventorySlotContents(player.inventory.currentItem,null);
              }
            }
 else {
              stack.splitStack(1);
              player.inventory.setInventorySlotContents(player.inventory.currentItem,stack);
            }
          }
        }
      }
 else {
        FluidStack tankContents=tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid;
        if (tankContents != null) {
          ItemStack filledContainer=FluidContainerRegistry.fillFluidContainer(tankContents,stack);
          FluidStack filledLiquid=FluidContainerRegistry.getFluidForFilledItem(filledContainer);
          if (filledLiquid != null) {
            if (!player.capabilities.isCreativeMode) {
              if (stack.stackSize == 1) {
                if (stack.getItem().hasContainerItem(stack)) {
                  player.inventory.setInventorySlotContents(player.inventory.currentItem,stack.getItem().getContainerItem(stack));
                }
 else {
                  player.inventory.setInventorySlotContents(player.inventory.currentItem,null);
                }
                player.inventory.setInventorySlotContents(player.inventory.currentItem,filledContainer);
              }
 else {
                if (!player.inventory.addItemStackToInventory(filledContainer)) {
                  return false;
                }
 else {
                  stack.splitStack(1);
                  player.inventory.setInventorySlotContents(player.inventory.currentItem,stack);
                  player.inventory.addItemStackToInventory(filledContainer);
                  player.inventory.markDirty();
                }
              }
            }
            tank.drain(ForgeDirection.UNKNOWN,filledLiquid.amount,true);
            update=true;
          }
        }
      }
    }
    if (update) {
      tank.markDirty();
      world.markBlockForUpdate(x,y,z);
      return true;
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int side,float fX,float fY,float fZ){
  boolean update=false;
  if (!world.isRemote) {
    TileEntityTank tank=(TileEntityTank)world.getTileEntity(x,y,z);
    ItemStack stack=player.getCurrentEquippedItem();
    if (stack != null && stack.getItem() != null) {
      FluidStack liquid=FluidContainerRegistry.getFluidForFilledItem(stack);
      if (liquid != null && liquid.getFluid() == FluidRegistry.WATER) {
        int quantity=tank.fill(ForgeDirection.UNKNOWN,liquid,false);
        if (quantity == liquid.amount) {
          tank.fill(ForgeDirection.UNKNOWN,liquid,true);
          update=true;
          if (!player.capabilities.isCreativeMode) {
            if (stack.stackSize == 1) {
              if (stack.getItem().hasContainerItem(stack)) {
                player.inventory.setInventorySlotContents(player.inventory.currentItem,stack.getItem().getContainerItem(stack));
              }
 else {
                player.inventory.setInventorySlotContents(player.inventory.currentItem,null);
              }
            }
 else {
              stack.splitStack(1);
              player.inventory.setInventorySlotContents(player.inventory.currentItem,stack);
            }
          }
        }
      }
 else {
        FluidStack tankContents=tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid;
        if (tankContents != null) {
          ItemStack filledContainer=FluidContainerRegistry.fillFluidContainer(tankContents,stack);
          FluidStack filledLiquid=FluidContainerRegistry.getFluidForFilledItem(filledContainer);
          if (filledLiquid != null) {
            if (!player.capabilities.isCreativeMode) {
              if (stack.stackSize == 1) {
                if (stack.getItem().hasContainerItem(stack)) {
                  player.inventory.setInventorySlotContents(player.inventory.currentItem,stack.getItem().getContainerItem(stack));
                }
 else {
                  player.inventory.setInventorySlotContents(player.inventory.currentItem,null);
                }
                player.inventory.setInventorySlotContents(player.inventory.currentItem,filledContainer);
              }
 else {
                if (!player.inventory.addItemStackToInventory(filledContainer)) {
                  return false;
                }
 else {
                  stack.splitStack(1);
                  player.inventory.setInventorySlotContents(player.inventory.currentItem,stack);
                  player.inventory.addItemStackToInventory(filledContainer);
                  player.inventory.markDirty();
                }
              }
            }
            tank.drain(ForgeDirection.UNKNOWN,filledLiquid.amount,true);
            update=true;
          }
        }
      }
    }
    if (update) {
      tank.markDirtyAndMarkForUpdate();
      world.markBlockForUpdate(x,y,z);
      return true;
    }
 else {
      return false;
    }
  }
  return true;
}