mirror of
				https://github.com/luanti-org/minetest_game.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Mapgen: Completely separate mgv6 ore registrations
This allows us to preserve mgv6 ore distribution while giving us the freedom to alter ore distribution for other mapgens. Other mapgens are larger scale and have 3D noise tunnels which make vertical travel easier, so ores can be deeper. Other mapgens have registered biomes which allows us to limit ores to certain biomes.
This commit is contained in:
		@@ -43,12 +43,12 @@ minetest.register_alias("mapgen_stair_sandstone_block", "stairs:stair_sandstone_
 | 
			
		||||
-- Register ores
 | 
			
		||||
--
 | 
			
		||||
 | 
			
		||||
-- Blob ores
 | 
			
		||||
-- These first to avoid other ores in blobs
 | 
			
		||||
 | 
			
		||||
-- Mgv6
 | 
			
		||||
 | 
			
		||||
function default.register_mgv6_blob_ores()
 | 
			
		||||
function default.register_mgv6_ores()
 | 
			
		||||
 | 
			
		||||
	-- Blob ore
 | 
			
		||||
	-- These first to avoid other ores in blobs
 | 
			
		||||
 | 
			
		||||
	-- Clay
 | 
			
		||||
	-- This first to avoid clay in sand blobs
 | 
			
		||||
@@ -134,14 +134,289 @@ function default.register_mgv6_blob_ores()
 | 
			
		||||
			persist = 0.0
 | 
			
		||||
		},
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	-- Scatter ores
 | 
			
		||||
 | 
			
		||||
	-- Coal
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_coal",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 8 * 8 * 8,
 | 
			
		||||
		clust_num_ores = 9,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = 1025,
 | 
			
		||||
		y_max          = 31000,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_coal",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 8 * 8 * 8,
 | 
			
		||||
		clust_num_ores = 8,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = -31000,
 | 
			
		||||
		y_max          = 64,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_coal",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 24 * 24 * 24,
 | 
			
		||||
		clust_num_ores = 27,
 | 
			
		||||
		clust_size     = 6,
 | 
			
		||||
		y_min          = -31000,
 | 
			
		||||
		y_max          = 0,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	-- Iron
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_iron",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 9 * 9 * 9,
 | 
			
		||||
		clust_num_ores = 12,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = 1025,
 | 
			
		||||
		y_max          = 31000,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_iron",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 7 * 7 * 7,
 | 
			
		||||
		clust_num_ores = 5,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = -31000,
 | 
			
		||||
		y_max          = 0,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_iron",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 24 * 24 * 24,
 | 
			
		||||
		clust_num_ores = 27,
 | 
			
		||||
		clust_size     = 6,
 | 
			
		||||
		y_min          = -31000,
 | 
			
		||||
		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({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_tin",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 10 * 10 * 10,
 | 
			
		||||
		clust_num_ores = 5,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = 1025,
 | 
			
		||||
		y_max          = 31000,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_tin",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 13 * 13 * 13,
 | 
			
		||||
		clust_num_ores = 4,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = -127,
 | 
			
		||||
		y_max          = -32,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_tin",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 10 * 10 * 10,
 | 
			
		||||
		clust_num_ores = 5,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = -31000,
 | 
			
		||||
		y_max          = -128,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	-- Gold
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_gold",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 13 * 13 * 13,
 | 
			
		||||
		clust_num_ores = 5,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = 1025,
 | 
			
		||||
		y_max          = 31000,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_gold",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 15 * 15 * 15,
 | 
			
		||||
		clust_num_ores = 3,
 | 
			
		||||
		clust_size     = 2,
 | 
			
		||||
		y_min          = -255,
 | 
			
		||||
		y_max          = -64,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_gold",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 13 * 13 * 13,
 | 
			
		||||
		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,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	-- Diamond
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_diamond",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 15 * 15 * 15,
 | 
			
		||||
		clust_num_ores = 4,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = 1025,
 | 
			
		||||
		y_max          = 31000,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_diamond",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 17 * 17 * 17,
 | 
			
		||||
		clust_num_ores = 4,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = -255,
 | 
			
		||||
		y_max          = -128,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:stone_with_diamond",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 15 * 15 * 15,
 | 
			
		||||
		clust_num_ores = 4,
 | 
			
		||||
		clust_size     = 3,
 | 
			
		||||
		y_min          = -31000,
 | 
			
		||||
		y_max          = -256,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	-- Mese block
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:mese",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 36 * 36 * 36,
 | 
			
		||||
		clust_num_ores = 3,
 | 
			
		||||
		clust_size     = 2,
 | 
			
		||||
		y_min          = 1025,
 | 
			
		||||
		y_max          = 31000,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type       = "scatter",
 | 
			
		||||
		ore            = "default:mese",
 | 
			
		||||
		wherein        = "default:stone",
 | 
			
		||||
		clust_scarcity = 36 * 36 * 36,
 | 
			
		||||
		clust_num_ores = 3,
 | 
			
		||||
		clust_size     = 2,
 | 
			
		||||
		y_min          = -31000,
 | 
			
		||||
		y_max          = -1024,
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- All mapgens except mgv6
 | 
			
		||||
 | 
			
		||||
function default.register_blob_ores()
 | 
			
		||||
function default.register_ores()
 | 
			
		||||
 | 
			
		||||
	-- Blob ore
 | 
			
		||||
	-- These first to avoid other ores in blobs
 | 
			
		||||
 | 
			
		||||
	-- Clay
 | 
			
		||||
	-- This first to avoid clay in sand blobs
 | 
			
		||||
 | 
			
		||||
	minetest.register_ore({
 | 
			
		||||
		ore_type        = "blob",
 | 
			
		||||
@@ -246,13 +521,8 @@ function default.register_blob_ores()
 | 
			
		||||
			"floatland_grassland", "floatland_grassland_ocean",
 | 
			
		||||
			"floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- Scatter ores
 | 
			
		||||
-- All mapgens
 | 
			
		||||
 | 
			
		||||
function default.register_ores()
 | 
			
		||||
	-- Scatter ores
 | 
			
		||||
 | 
			
		||||
	-- Coal
 | 
			
		||||
 | 
			
		||||
@@ -1853,20 +2123,17 @@ minetest.clear_registered_decorations()
 | 
			
		||||
 | 
			
		||||
local mg_name = minetest.get_mapgen_setting("mg_name")
 | 
			
		||||
if mg_name == "v6" then
 | 
			
		||||
	default.register_mgv6_blob_ores()
 | 
			
		||||
	default.register_ores()
 | 
			
		||||
	default.register_mgv6_ores()
 | 
			
		||||
	default.register_mgv6_decorations()
 | 
			
		||||
elseif mg_name == "v7" and captures_float == "floatlands" and
 | 
			
		||||
		captures_nofloat ~= "nofloatlands" then
 | 
			
		||||
	-- Mgv7 with floatlands
 | 
			
		||||
	default.register_biomes(mgv7_shadow_limit - 1)
 | 
			
		||||
	default.register_floatland_biomes(mgv7_floatland_level, mgv7_shadow_limit)
 | 
			
		||||
	default.register_blob_ores()
 | 
			
		||||
	default.register_ores()
 | 
			
		||||
	default.register_decorations()
 | 
			
		||||
else
 | 
			
		||||
	default.register_biomes(31000)
 | 
			
		||||
	default.register_blob_ores()
 | 
			
		||||
	default.register_ores()
 | 
			
		||||
	default.register_decorations()
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user