Chunks dimensions are 16x128x16. The minimum coordinate is (0, 0, 0), and the maximum coordinate is (15, 127, 15).
Step 1: Heightmap Generation.
This is the trickiest bit, and is responsible for the overall shape of the terrain and overhangs. I'm not going to describe it fully, but it uses Perlin noise as the base randomness function, which allows stuff to be seamless.
In this first pass, four block types are placed. For each block in the chunk, the first true option of the following determines the block type:
1) Stone: The block is below the terrain height.
2) Ice: The temperature is below 0.5, and the block height is 63 (sea level).
3) Water: The block height is less than or equal to sea level.
3) Air: Everything else.
Step 2: Top Layer & Bedrock
This replaces surface stone blocks with dirt, sand, and gravel. It also creates the bedrock layer.
Whether a vertical column contains a sand or gravel surface layer, along with the depth of the top layer, is stored in three 16x16 arrays generated using Perlin noise. Sand takes precedence over gravel, and gravel takes precedence over dirt.
A block becomes bedrock if its height is less than or equal to R[0, 4]. This explains why it's possible to sometimes fall through the bottom of the map-- it's not guaranteed to seal every hole with bedrock.
Step 3: Cave Generation
Again, this is kind of complex. Imagine the cave generation as worms that randomly tunnel, leaving air behind. Only stone, grass, and dirt are replaced with air. Blocks at or below 10 height are replaced with lava instead of air.
Step 4: Feature Placement
This is the useful part
[a, b] is a range from a to b, inclusive. [0, 3] includes 0, 1, 2, or 3.
R[a, b] is a random integer from a to b.
R[a] is a random integer from 0 to a.
RC is the same thing as <R[16],R[128],R[16]>
RC[y] is the same thing as <R[16], R[y], R[16]>
RCO is the same thing as <R[16]+8,R[128],R[16]+8>
P[x] means something happens with a probability of x. P[1/4] events happen 25% of the time.
Nx means something happens N times.
Ore deposits are generated as ellipsoids, and will only replace stone (unless otherwise noted). This means that if a diamond deposit is placed on top of a dirt deposit, there will be no diamonds generated. The given radius is the maximum axial radius. Actual sizes will almost always be smaller.
The steps are executed in the order I list them here.
P[1/4]: Lakes: attempt to create a small (ellipsoid) body of water at RCO.
P[1/8]: Lava pool: Select coordinate RCO. If P[1/10] or height (y) is less than 64, attempt to create a body of moving lava at the coordinate.
8x: Dungeon: Create a mob spawner at RCO. Will fail unless the floor and ceiling is solid and there are 2-3 player-sized gaps in the walls.
10x: Clay: Create a clay deposit at RC with radius 4. Will fail unless given coordinate is water. Will only replace sand. (N.B.: Clay generation is identical from 1.1_02 to 1.2_02)
20x: Dirt: Place at RC with radius 4.
10x: Gravel: Place at RC with radius 4.
20x: Coal: Place at RC with radius 2.
20x: Iron: Place at RC[64] with radius 2.
2x: Gold: Place at RC[32] with radius 1.
8x: Redstone: Place at RC[16] with radius 7/8.
Diamond: Place at RC[16] with radius 7/8.
Lapis: Place at RC[16]+<0,R[16],0> with radius 3/4. Note that the position is the sum of two evenly distributed ranges, which is indicated in the triangular frequency curve in the ore distribution charts.
Tree density times: Generate trees. Note that tree density in desert, tundra, and plains is almost always less than zero.
2x: Plant yellow flowers at RCO. Attempts to spawn 64 flowers within 16x8x16 cube centered at the position. Will fail unless chosen position is empty, above grass, and has light value of at least 8.
P[1/2]: Plant red flowers at RCO. Same constraints as yellow flowers.
P[1/4]: Plant brown mushrooms at RCO. Same generation strategy as yellow flowers, but will fail unless chosen position is empty, above a solid block, and has light value less than 14.
P[1/8]: Plant red mushrooms at RCO. Same constraints as brown mushrooms.
10x: Plant reeds at RCO. Attempts to spawn 20 reeds within 8x1x8 cube centered at the position. Will fail unless chosen position is empty and is adjacent to a water block. Reed height is 2+R[R[3]+1].
P[1/32]: Plant pumpkins at RCO. Attempts to spawn 64 pumpkins in a 16x8x16 cube centered at the position. Will fail unless chosen position is empty and above grass.
10x in desert biome, 0x otherwise: Plant cacti at RCO. Attempts to spawn 10 cacti within a 16x8x16 cube. Will fail unless chose position is empty, above sand, and has no adjacent solid blocks. Cactus height is 1+R[R[3]+1].
50x: Waterfall: Attempt to place a single water source block at RC[120]+<0,8,0>. Will fail unless the blocks above and below are stone, the block is air or not stone, and has 3 stone blocks and 1 air block in the NSEW directions. Basically, it lets you have rivers in caves.
20x: Lavafall: Same constraints thing as Waterfall, but place a lava source block.
For each column: If the temperature is less than 0.5 and the top solid block is not ice, put a snow block above it.
tl;dr: You can get at most one diamond cluster and one lapis cluster per chunk.
Thanks for that, it helps me understand some of my other reading material a little better. Would I be able to trouble you perhaps for a link to a more technical analysis, if you've written one?
Chunks dimensions are 16x128x16. The minimum coordinate is (0, 0, 0), and the maximum coordinate is (15, 127, 15).
Step 1: Heightmap Generation.
This is the trickiest bit, and is responsible for the overall shape of the terrain and overhangs. I'm not going to describe it fully, but it uses Perlin noise as the base randomness function, which allows stuff to be seamless.
In this first pass, four block types are placed. For each block in the chunk, the first true option of the following determines the block type:
1) Stone: The block is below the terrain height.
2) Ice: The temperature is below 0.5, and the block height is 63 (sea level).
3) Water: The block height is less than or equal to sea level.
3) Air: Everything else.
Step 2: Top Layer & Bedrock
This replaces surface stone blocks with dirt, sand, and gravel. It also creates the bedrock layer.
Whether a vertical column contains a sand or gravel surface layer, along with the depth of the top layer, is stored in three 16x16 arrays generated using Perlin noise. Sand takes precedence over gravel, and gravel takes precedence over dirt.
A block becomes bedrock if its height is less than or equal to R[0, 4]. This explains why it's possible to sometimes fall through the bottom of the map-- it's not guaranteed to seal every hole with bedrock.
Step 3: Cave Generation
Again, this is kind of complex. Imagine the cave generation as worms that randomly tunnel, leaving air behind. Only stone, grass, and dirt are replaced with air. Blocks at or below 10 height are replaced with lava instead of air.
Step 4: Feature Placement
This is the useful part
[a, b] is a range from a to b, inclusive. [0, 3] includes 0, 1, 2, or 3.
R[a, b] is a random integer from a to b.
R[a] is a random integer from 0 to a.
RC is the same thing as <R[16],R[128],R[16]>
RC[y] is the same thing as <R[16], R[y], R[16]>
RCO is the same thing as <R[16]+8,R[128],R[16]+8>
P[x] means something happens with a probability of x. P[1/4] events happen 25% of the time.
Nx means something happens N times.
Ore deposits are generated as ellipsoids, and will only replace stone (unless otherwise noted). This means that if a diamond deposit is placed on top of a dirt deposit, there will be no diamonds generated. The given radius is the maximum axial radius. Actual sizes will almost always be smaller.
The steps are executed in the order I list them here.
P[1/4]: Lakes: attempt to create a small (ellipsoid) body of water at RCO.
P[1/8]: Lava pool: Select coordinate RCO. If P[1/10] or height (y) is less than 64, attempt to create a body of moving lava at the coordinate.
8x: Dungeon: Create a mob spawner at RCO. Will fail unless the floor and ceiling is solid and there are 2-3 player-sized gaps in the walls.
10x: Clay: Create a clay deposit at RC with radius 4. Will fail unless given coordinate is water. Will only replace sand. (N.B.: Clay generation is identical from 1.1_02 to 1.2_02)
20x: Dirt: Place at RC with radius 4.
10x: Gravel: Place at RC with radius 4.
20x: Coal: Place at RC with radius 2.
20x: Iron: Place at RC[64] with radius 2.
2x: Gold: Place at RC[32] with radius 1.
8x: Redstone: Place at RC[16] with radius 7/8.
Diamond: Place at RC[16] with radius 7/8.
Lapis: Place at RC[16]+<0,R[16],0> with radius 3/4. Note that the position is the sum of two evenly distributed ranges, which is indicated in the triangular frequency curve in the ore distribution charts.
Tree density times: Generate trees. Note that tree density in desert, tundra, and plains is almost always less than zero.
2x: Plant yellow flowers at RCO. Attempts to spawn 64 flowers within 16x8x16 cube centered at the position. Will fail unless chosen position is empty, above grass, and has light value of at least 8.
P[1/2]: Plant red flowers at RCO. Same constraints as yellow flowers.
P[1/4]: Plant brown mushrooms at RCO. Same generation strategy as yellow flowers, but will fail unless chosen position is empty, above a solid block, and has light value less than 14.
P[1/8]: Plant red mushrooms at RCO. Same constraints as brown mushrooms.
10x: Plant reeds at RCO. Attempts to spawn 20 reeds within 8x1x8 cube centered at the position. Will fail unless chosen position is empty and is adjacent to a water block. Reed height is 2+R[R[3]+1].
P[1/32]: Plant pumpkins at RCO. Attempts to spawn 64 pumpkins in a 16x8x16 cube centered at the position. Will fail unless chosen position is empty and above grass.
10x in desert biome, 0x otherwise: Plant cacti at RCO. Attempts to spawn 10 cacti within a 16x8x16 cube. Will fail unless chose position is empty, above sand, and has no adjacent solid blocks. Cactus height is 1+R[R[3]+1].
50x: Waterfall: Attempt to place a single water source block at RC[120]+<0,8,0>. Will fail unless the blocks above and below are stone, the block is air or not stone, and has 3 stone blocks and 1 air block in the NSEW directions. Basically, it lets you have rivers in caves.
20x: Lavafall: Same constraints thing as Waterfall, but place a lava source block.
For each column: If the temperature is less than 0.5 and the top solid block is not ice, put a snow block above it.
tl;dr: You can get at most one diamond cluster and one lapis cluster per chunk.
Member of the official ctm pillar club
Xie's Farming (and others);
Syrup's Fancypack, Expanded Farming and Stained Glass;
Seronis's Mods;
303's Arrows and Prefix Skeletons;
This has been an unpaid, unscripted presentation.