mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-07-20 00:20:24 +02:00
OK, ROLLBACK!
- All the modifications done before7845fd5f1f
are reverted - Merged commits from http://github.com/minetest/minetest_game from 10 days ago to today. (concerning default mod) TODO: Merge the other mods which have been reverted. Add all the commits of Ombridride after the7845fd5f1f
one. Signed-off-by: LeMagnesium <mg.minetest@gmail.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
function flowers.mgv6ongen(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 @@ minetest.register_on_generated(function(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,19 +50,21 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
elseif flower_choice == 6 then
|
||||
flower = "flowers:viola"
|
||||
end
|
||||
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"})
|
||||
minetest.set_node(p, {name=flower})
|
||||
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)
|
||||
|
Reference in New Issue
Block a user