Remove unused jungle tree generation code

This commit is contained in:
Wuzzy 2017-08-21 12:50:35 +02:00
parent 8b4977f1df
commit b62349bc9f

View file

@ -288,136 +288,7 @@ function mcl_core.generate_tree(pos, trunk, leaves, typearbre)
end end
end end
elseif typearbre == 2 then elseif typearbre == 2 then
node = {name = ""} -- EMPTY
-- can place big tree ?
local tree_size = math.random(15, 25)
for dy=1,4 do
pos.y = pos.y+dy
if minetest.get_node(pos).name ~= "air" then
return
end
pos.y = pos.y-dy
end
--Cheak for placing big tree
pos.y = pos.y-1
for dz=0,1 do
pos.z = pos.z + dz
--> 0
local name = minetest.get_node(pos).name
if name == "mcl_core:dirt_with_grass"
or name == "mcl_core:dirt_with_grass_snow"
or name == "mcl_core:dirt" then else
return
end
pos.x = pos.x+1
--> 1
if name == "mcl_core:dirt_with_grass"
or name == "mcl_core:dirt_with_grass_snow"
or name == "mcl_core:dirt" then else
return
end
pos.x = pos.x-1
pos.z = pos.z - dz
end
pos.y = pos.y+1
-- Make tree with vine
node = {name = trunk}
for dy=0,tree_size do
pos.y = pos.y+dy
for dz=-1,2 do
if dz == -1 then
pos.z = pos.z + dz
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "mcl_core:vine", param2 = 4})
end
pos.x = pos.x+1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "mcl_core:vine", param2 = 4})
end
pos.x = pos.x-1
pos.z = pos.z - dz
elseif dz == 2 then
pos.z = pos.z + dz
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air"then
minetest.add_node(pos, {name = "mcl_core:vine", param2 = 5})
end
pos.x = pos.x+1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "mcl_core:vine", param2 = 5})
end
pos.x = pos.x-1
pos.z = pos.z - dz
else
pos.z = pos.z + dz
pos.x = pos.x-1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "mcl_core:vine", param2 = 2})
end
pos.x = pos.x+1
if minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = trunk, param2=2})
end
pos.x = pos.x+1
if minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = trunk, param2=2})
end
pos.x = pos.x+1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "mcl_core:vine", param2 = 3})
end
pos.x = pos.x-2
pos.z = pos.z - dz
end
end
pos.y = pos.y-dy
end
-- make leaves
node = {name = leaves}
pos.y = pos.y+tree_size-4
for dx=-4,4 do
for dz=-4,4 do
for dy=0,3 do
pos.x = pos.x+dx
pos.y = pos.y+dy
pos.z = pos.z+dz
if dx == 0 and dz == 0 and dy==3 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" and math.random(1, 2) == 1 then
minetest.add_node(pos, node)
end
elseif dx == 0 and dz == 0 and dy==4 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" and math.random(1, 5) == 1 then
minetest.add_node(pos, node)
minetest.add_node(pos, air_leaf(leaves))
end
elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" then
minetest.add_node(pos, node)
end
else
if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" and math.random(1, 3) == 1 then
minetest.add_node(pos, node)
end
else
if math.random(1, 5) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, node)
end
end
end
pos.x = pos.x-dx
pos.y = pos.y-dy
pos.z = pos.z-dz
end
end
end
elseif typearbre == 3 then elseif typearbre == 3 then
mcl_core.generate_spruce_tree(pos) mcl_core.generate_spruce_tree(pos)
elseif typearbre == 4 then elseif typearbre == 4 then