1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-28 23:40:17 +01:00

use the default pine tree node, try to improve performance in mapgen_v6 and comment a weird "and y ~= "air")"

This commit is contained in:
HybridDog 2015-03-05 17:36:02 +01:00
parent 943efa6110
commit e889cbc6a4
2 changed files with 12 additions and 12 deletions

View File

@ -40,7 +40,7 @@ local pine_tree = {
axiom="TABff",
rules_a="[&T+f+ff+ff+ff+f]GA",
rules_b="[&T+f+Gf+Gf+Gf]GB",
trunk="default:tree",
trunk="default:pinetree",
leaves="snow:needles",
angle=90,
iterations=1,
@ -55,7 +55,7 @@ local xmas_tree = {
axiom="TABff",
rules_a="[&T+f+ff+ff+ff+f]GA",
rules_b="[&T+f+Gf+Gf+Gf]GB",
trunk="default:tree",
trunk="default:pinetree",
leaves="snow:needles_decorated",
angle=90,
iterations=1,
@ -118,7 +118,7 @@ end
function snow.voxelmanip_pine(pos,a,data)
local c_snow = minetest.get_content_id("default:snow")
local c_pine_needles = minetest.get_content_id("snow:needles")
local c_tree = minetest.get_content_id("default:tree")
local c_pinetree = minetest.get_content_id("default:pinetree")
local c_air = minetest.get_content_id("air")
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
@ -170,7 +170,7 @@ function snow.voxelmanip_pine(pos,a,data)
end
end
end
data[a:index(pos.x,pos.y+i,pos.z)] = c_tree
data[a:index(pos.x,pos.y+i,pos.z)] = c_pinetree
end
data[a:index(pos.x,pos.y+5,pos.z)] = c_pine_needles
data[a:index(pos.x,pos.y+6,pos.z)] = c_pine_needles

View File

@ -256,24 +256,24 @@ minetest.register_on_generated(function(minp, maxp, seed)
local rand = pr:next(1,4) == 1
if ((x1 and x1 ~= c_water and x1 ~= c_ice
and x1 ~= c_air and x1 ~= c_ignore)
or ((cool or icebergs) and x1 == c_ice and rand))
or (rand and (cool or icebergs) and x1 == c_ice))
or ((z1 and z1 ~= c_water and z1 ~= c_ice
and z1 ~= c_air and z1 ~= c_ignore)
or ((cool or icebergs) and z1 == c_ice and rand))
or (rand and (cool or icebergs) and z1 == c_ice))
or ((xz1 and xz1 ~= c_water and xz1 ~= c_ice
and xz1 ~= c_air and xz1 ~= c_ignore)
or ((cool or icebergs) and xz1 == c_ice and rand))
or (rand and (cool or icebergs) and xz1 == c_ice))
or ((xz2 and xz2 ~= c_water and xz2 ~= c_ice
and xz2 ~= c_air and xz2 ~= c_ignore)
or ((cool or icebergs) and xz2 == c_ice and rand))
or (rand and (cool or icebergs) and xz2 == c_ice))
or ((x2 and x2 ~= c_water and x2 ~= c_ice
and x2 ~= c_air and x2 ~= c_ignore)
or ((cool or icebergs) and x2 == c_ice and rand))
or (rand and (cool or icebergs) and x2 == c_ice))
or ((z2 and z2 ~= c_water and z2 ~= c_ice
and z2 ~= c_air and z2 ~= c_ignore)
or ((cool or icebergs) and z2 == c_ice and rand))
or (y ~= c_water and y ~= c_ice and y ~= "air")
or (pr:next(1,6) == 1 and icebergs) then
or (rand and (cool or icebergs) and z2 == c_ice))
or (y ~= c_water and y ~= c_ice) -- and y ~= "air") …I don't think y can be a string here ~HybridDog
or (icebergs and pr:next(1,6) == 1) then
data[node] = c_ice
end
else