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

Workaround for plantlife bug.

This commit is contained in:
Splizard 2014-06-05 15:49:24 +12:00
parent 848f30543d
commit 1cc2c6758b

View File

@ -121,6 +121,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end]] end]]
local write_to_map = false
--Loop through chunk. --Loop through chunk.
for x = minp.x, maxp.x do for x = minp.x, maxp.x do
for z = minp.z, maxp.z do for z = minp.z, maxp.z do
@ -135,6 +137,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
if in_biome then if in_biome then
write_to_map = true
local perlin2 = env:get_perlin(322345,3, 0.5, 80) local perlin2 = env:get_perlin(322345,3, 0.5, 80)
local icetype = perlin2:get2d({x=x, y=z}) local icetype = perlin2:get2d({x=x, y=z})
@ -259,20 +262,23 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end end
vm:set_data(data) if write_to_map then
vm:set_data(data)
vm:calc_lighting( vm:calc_lighting(
{x=minp.x-16, y=minp.y, z=minp.z-16}, {x=minp.x-16, y=minp.y, z=minp.z-16},
{x=maxp.x+16, y=maxp.y, z=maxp.z+16} {x=maxp.x+16, y=maxp.y, z=maxp.z+16}
) )
vm:write_to_map(data) vm:write_to_map(data)
vm:update_map()
if debug then if debug then
biome_string,biome2_string = biomeToString(biome,biome2) biome_string,biome2_string = biomeToString(biome,biome2)
print(biome_string.." and "..biome2_string..": Snow Biome Genarated near x"..minp.x.." z"..minp.z) print(biome_string.." and "..biome2_string..": Snow Biome Genarated near x"..minp.x.." z"..minp.z)
print(string.format("elapsed time: %.2fms", (os.clock() - t1) * 1000)) print(string.format("elapsed time: %.2fms", (os.clock() - t1) * 1000))
end
end end
--end --end
end) end)