1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-29 16:00:16 +01:00

spawn pines after generating the ground to fix a few grass places (untested)

This commit is contained in:
HybridDog 2015-06-19 19:49:31 +02:00
parent 4286299c0e
commit 51aa9a372b

View File

@ -96,7 +96,6 @@ minetest.register_on_generated(function(minp, maxp, seed)
local x1 = maxp.x local x1 = maxp.x
local z1 = maxp.z local z1 = maxp.z
local spawn_pine = snow.voxelmanip_pine
local smooth = snow.smooth_biomes local smooth = snow.smooth_biomes
if not c then if not c then
@ -109,6 +108,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local param2s = vm:get_param2_data() local param2s = vm:get_param2_data()
local snow_tab,num = {},1 local snow_tab,num = {},1
local pines_tab,pnum = {},1
local sidelen = x1 - x0 + 1 local sidelen = x1 - x0 + 1
local chulens = {x=sidelen, y=sidelen, z=sidelen} local chulens = {x=sidelen, y=sidelen, z=sidelen}
@ -215,8 +215,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
elseif pines elseif pines
and pr:next(1,36) == 1 then and pr:next(1,36) == 1 then
data[node] = c.dirt_with_snow pines_tab[pnum] = {x=x, y=ground_y+1, z=z}
spawn_pine({x=x, y=ground_y+1, z=z}, area, data) pnum = pnum+1
elseif shrubs elseif shrubs
and pr:next(1,928) == 1 then and pr:next(1,928) == 1 then
data[node] = c.dirt_with_snow data[node] = c.dirt_with_snow
@ -384,6 +384,15 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end end
-- spawn pines
if pines
and pnum ~= 1 then
local spawn_pine = snow.voxelmanip_pine
for _,pos in pairs(pines_tab) do
spawn_pine(pos, area, data)
end
end
vm:set_data(data) vm:set_data(data)
vm:set_param2_data(param2s) vm:set_param2_data(param2s)
vm:set_lighting({day=0, night=0}) vm:set_lighting({day=0, night=0})