Where are biomes saved in minecraft?

I remember reading at GetSatisfaction and also somewhere else that biomes are not saved together with the chunks, but instead are calculated on-the-fly based on some random generator.

Is this true? Are biomes saved together with the map data? Or are they always generated from a seed?

Related question (that inspired this one): How can I copy part of a Minecraft world into another Minecraft world?

Edit: Just to clarify, I'm asking about the biome information (which is used for defining the grass color and if it rains or snows). I'm not asking about the actual blocks (that I know are saved in *.mcr files).


Solution 1:

Biomes are generated from the level seed stored in the level.dat file. This is one of the reasons you can visit maps from prior versions and find biome-like coloring (and why expanding the map will generate biome terrain).

The chunk terrain, however, is saved, so areas that were sand will still be sand regardless of what "biome" the game thinks it's in. Terrain already generated won't change, so if the level seed changes, you can find a grassy or snowy area next to a desert along the boundaries of the chunks.

Solution 2:

Since Minecraft 1.2:

In the Anvil file format, biomes are stored directly in the world data.