mixed layers
parent
e1e876b501
commit
9528f68cdd
|
@ -55,7 +55,15 @@ planetoids.mapgen_oreplanet = function(minp, maxp, vm, area)
|
||||||
data[index] = c_base
|
data[index] = c_base
|
||||||
for _,ore in pairs(planetoids.ores) do
|
for _,ore in pairs(planetoids.ores) do
|
||||||
if planet_n > ore.chance then
|
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
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
22
ores.lua
22
ores.lua
|
@ -10,22 +10,20 @@ register_ore({
|
||||||
})
|
})
|
||||||
|
|
||||||
register_ore({
|
register_ore({
|
||||||
id = minetest.get_content_id("default:stone_with_mese"),
|
id_list = {
|
||||||
chance = 1.1
|
minetest.get_content_id("default:stone_with_mese"),
|
||||||
})
|
minetest.get_content_id("default:stone_with_copper"),
|
||||||
|
minetest.get_content_id("default:stone_with_iron"),
|
||||||
register_ore({
|
},
|
||||||
id = minetest.get_content_id("default:stone_with_iron"),
|
|
||||||
chance = 1.0
|
chance = 1.0
|
||||||
})
|
})
|
||||||
|
|
||||||
register_ore({
|
register_ore({
|
||||||
id = minetest.get_content_id("default:stone_with_gold"),
|
id_list = {
|
||||||
chance = 0.99
|
minetest.get_content_id("default:stone_with_iron"),
|
||||||
})
|
minetest.get_content_id("default:stone_with_gold"),
|
||||||
|
minetest.get_content_id("default:stone_with_copper"),
|
||||||
register_ore({
|
},
|
||||||
id = minetest.get_content_id("default:stone_with_copper"),
|
|
||||||
chance = 0.98
|
chance = 0.98
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue