Skip to content

Commit

Permalink
mixed layers
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay authored and BuckarooBanzay committed Jan 9, 2020
1 parent e1e876b commit 9528f68
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
10 changes: 9 additions & 1 deletion mapgen_oreplanet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,15 @@ planetoids.mapgen_oreplanet = function(minp, maxp, vm, area)
data[index] = c_base
for _,ore in pairs(planetoids.ores) do
if planet_n > ore.chance then
data[index] = ore.id
if ore.id then
-- "plain" layer
data[index] = ore.id

elseif ore.id_list then
-- mixed layer
data[index] = ore.id_list[math.random(1,#ore.id_list)]
end

break
end
end
Expand Down
22 changes: 10 additions & 12 deletions ores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ register_ore({
})

register_ore({
id = minetest.get_content_id("default:stone_with_mese"),
chance = 1.1
})

register_ore({
id = minetest.get_content_id("default:stone_with_iron"),
id_list = {
minetest.get_content_id("default:stone_with_mese"),
minetest.get_content_id("default:stone_with_copper"),
minetest.get_content_id("default:stone_with_iron"),
},
chance = 1.0
})

register_ore({
id = minetest.get_content_id("default:stone_with_gold"),
chance = 0.99
})

register_ore({
id = minetest.get_content_id("default:stone_with_copper"),
id_list = {
minetest.get_content_id("default:stone_with_iron"),
minetest.get_content_id("default:stone_with_gold"),
minetest.get_content_id("default:stone_with_copper"),
},
chance = 0.98
})

Expand Down

0 comments on commit 9528f68

Please sign in to comment.