When choosing a random mapgen group, only select between groups that have buildings which can spawn at that height range. Also get rid of the mapgen group caching and get groups directly from the mapgen table.