Added crystal crafts and spawning

fixes #141
master
D00Med 2018-02-07 17:22:27 +10:00
parent 8bbe007ecb
commit 275c5f438d
2 changed files with 33 additions and 0 deletions

View File

@ -1,4 +1,17 @@
minetest.register_craft( {
output = "mapgen:crystal_shard 4",
recipe = {
{ "mapgen:crystal",},
}
})
minetest.register_craft( {
output = "mapgen:crystal_shard 2",
recipe = {
{ "mapgen:crystal_small",},
}
})
minetest.register_craft( {
output = "decoblocks:bamboo_block 4",

View File

@ -2900,6 +2900,26 @@ minetest.register_on_generated(function(minp, maxp)
end
end)
minetest.register_on_generated(function(minp, maxp)
if maxp.y < -2000 or maxp.y > 1500 then
return
end
local stone = minetest.find_nodes_in_area(minp, maxp,
{"default:stone"})
for n = 1, #stone do
if math.random(1, 150) == 1 then
local pos = {x = stone[n].x, y = stone[n].y, z = stone[n].z }
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "air" then
if math.random(1,5) == 1 then
minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "mapgen:crystal_small"})
else
minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "mapgen:crystal"})
end
end
end
end
end)
--underground dungeons
local dungeon_rarity = 1000