From: PilzAdam Date: Fri, 4 Jan 2013 20:55:31 +0000 (+0100) Subject: Expose generate_ore X-Git-Tag: 0.4.5~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=97db50a2fe055c1e74031a7cd2d4bb5c5f222615;p=oweals%2Fminetest_game.git Expose generate_ore --- diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 977aac7d..8f020b92 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -29,7 +29,7 @@ minetest.register_alias("mapgen_desert_stone", "default:desert_stone") -- Ore generation -- -local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) +function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) if maxp.y < height_min or minp.y > height_max then return end @@ -142,17 +142,17 @@ end minetest.register_on_generated(function(minp, maxp, seed) -- Generate regular ores - generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8, 3, 8, -31000, 64) - generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3, -15, 2) - generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9, 3, 5, -63, -16) - generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7, 3, 5, -31000, -64) + default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8, 3, 8, -31000, 64) + default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3, -15, 2) + default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9, 3, 5, -63, -16) + default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7, 3, 5, -31000, -64) - generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3, -127, -64) - generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+5, 1/9/9/9, 3, 5, -31000, -128) - generate_ore("default:mese", "default:stone", minp, maxp, seed+8, 1/16/16/16, 2, 3, -31000,-1024) + default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3, -127, -64) + default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+5, 1/9/9/9, 3, 5, -31000, -128) + default.generate_ore("default:mese", "default:stone", minp, maxp, seed+8, 1/16/16/16, 2, 3, -31000,-1024) - generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000, 0) - generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64) + default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000, 0) + default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64) if maxp.y >= 2 and minp.y <= 0 then -- Generate clay