You’ll probably still be sipping coffee 30 years from now, but if the world keeps warming at the current pace, expect it to be a lot more expensive and not nearly as good.

If left unchecked, climate change could cut in half the amount of land suitable for growing coffee beans by 2050, according to a report (pdf) released Aug. 29 by the Climate Institute, an Australia-based think tank. For example, Mexico could lose most of its plantations by 2020, and Nicaragua would follow by 2050. The wild Arabica coffee plant, the ancestor of much of the beans the world brews today, could become fully extinct by the end of the century.

Good coffee beans are fickle. The Arabica variety is particular sensitive—it likes to grow in a narrow temperature range of 18 to 21 degrees Celsius (64-70 degrees Fahrenheit) in high altitudes. Too much rain or too little rain can damage the plants, and so can the pests that thrive in warmer weather. All of these conditions are becoming more common. (Arabica, which is overwhelmingly produced in Latin America, accounts for 70% of the world’s coffee supplies.)

Meanwhile, our thirst for steaming mugs of java keeps growing. As it is now we drink about 2.25 billion cups a day, and production is barely keeping up. Bean stockpiles are expected to drop to a four-year low (pdf, pg. 1) in the 2016-2017 growing season.

Coffee grows best in tropical regions, where the effects of climate change are expected to hit sooner and harder. Indeed, of the top ten countries most affected by extreme weather, seven are coffee growers, according to the 2016 Global Climate Risk Index (pdf, pg. 6) compiled by NGP Germanwatch. Together, they account for more than a quarter of the world’s bean production.

Rank Country Global share of coffee production 1 Honduras 4% 3 Haiti 0.2% 4 Philippines 0.1% 5 Nicaragua 1.2% 7 Vietnam 19% 9 Thailand 0.3% 10 Guatemala 2.4% Total 27.2%

The damage spreads beyond that list. Heavy rains are forecast to cut Colombia’s production in the 2016-2017 season, according to the US Department of Agriculture, which tracks commodity markets around the world. Meanwhile, in Indonesia, coffee farmers will blame drought for their smaller crop this growing season.

Coffee leaf rust (link in Spanish), known as la roya in Spanish, has already been decimating plantations in Mexico and Central America, which combined produce more than 15% of the world’s Arabica beans. The fungus, which reduces robust coffee plants to twigs, has thrived in unusually warm weather in the coffee-growing areas of that region of the world. Mean temperatures in Mexico, Guatemala and Honduras are hotter by one degree Celsius compared with the 1980’s according to the Climate Institute report, which was commissioned by Fairtrade Australia & New Zealand.

The good news: we still have time to save coffee—as long as we help growers protect precious coffee plants from the ravages of weather, says Brenda Ekwurzel, climate science director at the Union of Concerned Scientists. Some small-scale farmers are already taking measures to fight back, such as planting tall trees to protect their crop from storms, and erecting hedges that act as wind barriers.

In Honduras, which was also plagued by coffee leaf rust in past years, production is rebounding after locals started planting more roya-resistant coffee varieties.

Coffee behemoth Starbucks has committed to replacing roya-damaged coffee trees, and other companies, such as Keurig Green Mountain, are funding research to preserve coffee in innovative ways, like cross-breeding different species to create more resilient and genetically-diverse varietals.

And there’s always hope that the world’s nations will abide by their commitments to limit global warming made during the international climate conference held in Paris last year. Environmental devastation aside, the prospect of coffee-less mornings should be enough of a motivator.