The Portuguese were the leaders here. The Pope divided the world between the Spanish and the Portuguese and let the Portuguese sail east and the Spanish Sail west, to 'convert the world,' so Vasco de Gama rounded Cape Horn and voila, colonies in the Indian Ocean. Mocambique, Goa, Moluccas and the Spice Islands, also in China they settled in- Formosa, Macao, Xiamen, and then also Japan.
The Chinese had outlawed gunpowder long before, and considered it a crime against humanity to use it. That is why they never stood a chance against the rising tide of Europeans. Moreover, later they were addicted to Opium, but that is another story involving the British.