1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-07-20 00:20:24 +02:00

Merge server to github

This commit is contained in:
Ombridride
2014-12-11 18:53:00 +01:00
parent a7dc6bdff7
commit 887473124e
6873 changed files with 930 additions and 385 deletions

View File

@ -1,4 +1,4 @@
function flowers.mgv6ongen(minp, maxp, seed)
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y >= 2 and minp.y <= 0 then
-- Generate flowers
local perlin1 = minetest.get_perlin(436, 3, 0.6, 100)
@ -21,19 +21,19 @@ function flowers.mgv6ongen(minp, maxp, seed)
-- Find ground level (0...15)
local ground_y = nil
for y=30,0,-1 do
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
if minetest.get_node({x = x, y = y, z = z}).name ~= "air" then
ground_y = y
break
end
end
if ground_y then
local p = {x=x,y=ground_y+1,z=z}
local p = {x = x, y = ground_y + 1, z = z}
local nn = minetest.get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
nn = minetest.get_node({x=x,y=ground_y,z=z}).name
nn = minetest.get_node({x = x, y = ground_y, z = z}).name
if nn == "default:dirt_with_grass" then
local flower_choice = pr:next(1, 6)
local flower
@ -50,21 +50,19 @@ function flowers.mgv6ongen(minp, maxp, seed)
elseif flower_choice == 6 then
flower = "flowers:viola"
end
minetest.set_node(p, {name=flower})
minetest.set_node(p, {name = flower})
elseif nn == "default:water_source" then
minetest.set_node(p, {name = "flowers:lily_pad"})
elseif nn == "default:sand" then
minetest.set_node(p, {name = "default:dry_shrub"})
elseif nn == "default:dirt_with_snow" then
minetest.set_node(p, {name = "default:snow"})
end
end
end
end
end
end
end
end
-- Enable in mapgen v6 only
minetest.register_on_mapgen_init(function(mg_params)
if mg_params.mgname == "v6" then
minetest.register_on_generated(flowers.mgv6ongen)
end
end)