From 74ed63f46ba8c86de1b30c53c2d9f8947a0cdd34 Mon Sep 17 00:00:00 2001
From: paramat <paramat@users.noreply.github.com>
Date: Sun, 2 Jul 2017 14:22:00 +0100
Subject: [PATCH] Ores (non-mgv6 mapgens): New distributions

Make deeper, to compensate for ease of travel using 3D noise tunnels.
Make depth more progressive with value:

Ore, upper limit

Coal 64 no change
Iron 0 no change
Tin -32 > -64
Copper -16 > -128
Gold -64 > -256
Diamond -128 > -512
Mese crystal -64 > -512
Mese block -1024 no change

Make y of 1st density increase deeper but following a similar logic to before:

Ore, upper limit

Coal 0 no change
Iron -64 no change
Tin -128 no change
Copper -64 > -256
Gold -256 > -1024
Diamond -256 > -1024
Mese crystal -256 > -1024
Mese block -2048 new

Add second, denser layer of mese blocks with a decrease of separation and
increase in density equal to mese ore layers.
---
 mods/default/mapgen.lua | 167 +++++++++++++++++++++-------------------
 1 file changed, 89 insertions(+), 78 deletions(-)

diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua
index ebb93d3..4503d53 100644
--- a/mods/default/mapgen.lua
+++ b/mods/default/mapgen.lua
@@ -591,41 +591,6 @@ function default.register_ores()
 		y_max          = -64,
 	})
 
-	-- Copper
-
-	minetest.register_ore({
-		ore_type       = "scatter",
-		ore            = "default:stone_with_copper",
-		wherein        = "default:stone",
-		clust_scarcity = 9 * 9 * 9,
-		clust_num_ores = 5,
-		clust_size     = 3,
-		y_min          = 1025,
-		y_max          = 31000,
-	})
-
-	minetest.register_ore({
-		ore_type       = "scatter",
-		ore            = "default:stone_with_copper",
-		wherein        = "default:stone",
-		clust_scarcity = 12 * 12 * 12,
-		clust_num_ores = 4,
-		clust_size     = 3,
-		y_min          = -63,
-		y_max          = -16,
-	})
-
-	minetest.register_ore({
-		ore_type       = "scatter",
-		ore            = "default:stone_with_copper",
-		wherein        = "default:stone",
-		clust_scarcity = 9 * 9 * 9,
-		clust_num_ores = 5,
-		clust_size     = 3,
-		y_min          = -31000,
-		y_max          = -64,
-	})
-
 	-- Tin
 
 	minetest.register_ore({
@@ -647,7 +612,7 @@ function default.register_ores()
 		clust_num_ores = 4,
 		clust_size     = 3,
 		y_min          = -127,
-		y_max          = -32,
+		y_max          = -64,
 	})
 
 	minetest.register_ore({
@@ -661,6 +626,41 @@ function default.register_ores()
 		y_max          = -128,
 	})
 
+	-- Copper
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_copper",
+		wherein        = "default:stone",
+		clust_scarcity = 9 * 9 * 9,
+		clust_num_ores = 5,
+		clust_size     = 3,
+		y_min          = 1025,
+		y_max          = 31000,
+	})
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_copper",
+		wherein        = "default:stone",
+		clust_scarcity = 12 * 12 * 12,
+		clust_num_ores = 4,
+		clust_size     = 3,
+		y_min          = -255,
+		y_max          = -128,
+	})
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_copper",
+		wherein        = "default:stone",
+		clust_scarcity = 9 * 9 * 9,
+		clust_num_ores = 5,
+		clust_size     = 3,
+		y_min          = -31000,
+		y_max          = -256,
+	})
+
 	-- Gold
 
 	minetest.register_ore({
@@ -681,8 +681,8 @@ function default.register_ores()
 		clust_scarcity = 15 * 15 * 15,
 		clust_num_ores = 3,
 		clust_size     = 2,
-		y_min          = -255,
-		y_max          = -64,
+		y_min          = -1023,
+		y_max          = -256,
 	})
 
 	minetest.register_ore({
@@ -693,42 +693,7 @@ function default.register_ores()
 		clust_num_ores = 5,
 		clust_size     = 3,
 		y_min          = -31000,
-		y_max          = -256,
-	})
-
-	-- Mese crystal
-
-	minetest.register_ore({
-		ore_type       = "scatter",
-		ore            = "default:stone_with_mese",
-		wherein        = "default:stone",
-		clust_scarcity = 14 * 14 * 14,
-		clust_num_ores = 5,
-		clust_size     = 3,
-		y_min          = 1025,
-		y_max          = 31000,
-	})
-
-	minetest.register_ore({
-		ore_type       = "scatter",
-		ore            = "default:stone_with_mese",
-		wherein        = "default:stone",
-		clust_scarcity = 18 * 18 * 18,
-		clust_num_ores = 3,
-		clust_size     = 2,
-		y_min          = -255,
-		y_max          = -64,
-	})
-
-	minetest.register_ore({
-		ore_type       = "scatter",
-		ore            = "default:stone_with_mese",
-		wherein        = "default:stone",
-		clust_scarcity = 14 * 14 * 14,
-		clust_num_ores = 5,
-		clust_size     = 3,
-		y_min          = -31000,
-		y_max          = -256,
+		y_max          = -1024,
 	})
 
 	-- Diamond
@@ -751,8 +716,8 @@ function default.register_ores()
 		clust_scarcity = 17 * 17 * 17,
 		clust_num_ores = 4,
 		clust_size     = 3,
-		y_min          = -255,
-		y_max          = -128,
+		y_min          = -1023,
+		y_max          = -512,
 	})
 
 	minetest.register_ore({
@@ -763,7 +728,42 @@ function default.register_ores()
 		clust_num_ores = 4,
 		clust_size     = 3,
 		y_min          = -31000,
-		y_max          = -256,
+		y_max          = -1024,
+	})
+
+	-- Mese crystal
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_mese",
+		wherein        = "default:stone",
+		clust_scarcity = 14 * 14 * 14,
+		clust_num_ores = 5,
+		clust_size     = 3,
+		y_min          = 1025,
+		y_max          = 31000,
+	})
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_mese",
+		wherein        = "default:stone",
+		clust_scarcity = 18 * 18 * 18,
+		clust_num_ores = 3,
+		clust_size     = 2,
+		y_min          = -1023,
+		y_max          = -512,
+	})
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:stone_with_mese",
+		wherein        = "default:stone",
+		clust_scarcity = 14 * 14 * 14,
+		clust_num_ores = 5,
+		clust_size     = 3,
+		y_min          = -31000,
+		y_max          = -1024,
 	})
 
 	-- Mese block
@@ -786,9 +786,20 @@ function default.register_ores()
 		clust_scarcity = 36 * 36 * 36,
 		clust_num_ores = 3,
 		clust_size     = 2,
-		y_min          = -31000,
+		y_min          = -2047,
 		y_max          = -1024,
 	})
+
+	minetest.register_ore({
+		ore_type       = "scatter",
+		ore            = "default:mese",
+		wherein        = "default:stone",
+		clust_scarcity = 28 * 28 * 28,
+		clust_num_ores = 5,
+		clust_size     = 3,
+		y_min          = -31000,
+		y_max          = -2048,
+	})
 end