1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00

Default/trees: Update to 'get_mapgen_setting()'

This commit is contained in:
paramat 2016-07-18 22:50:00 +01:00
parent f018e06d9b
commit 1a2eb89f17

View File

@ -43,12 +43,12 @@ function default.grow_sapling(pos)
return return
end end
local mapgen = minetest.get_mapgen_params().mgname local mg_name = minetest.get_mapgen_setting("mg_name")
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
if node.name == "default:sapling" then if node.name == "default:sapling" then
minetest.log("action", "A sapling grows into a tree at ".. minetest.log("action", "A sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
if mapgen == "v6" then if mg_name == "v6" then
default.grow_tree(pos, random(1, 4) == 1) default.grow_tree(pos, random(1, 4) == 1)
else else
default.grow_new_apple_tree(pos) default.grow_new_apple_tree(pos)
@ -56,7 +56,7 @@ function default.grow_sapling(pos)
elseif node.name == "default:junglesapling" then elseif node.name == "default:junglesapling" then
minetest.log("action", "A jungle sapling grows into a tree at ".. minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
if mapgen == "v6" then if mg_name == "v6" then
default.grow_jungle_tree(pos) default.grow_jungle_tree(pos)
else else
default.grow_new_jungle_tree(pos) default.grow_new_jungle_tree(pos)
@ -65,7 +65,7 @@ function default.grow_sapling(pos)
minetest.log("action", "A pine sapling grows into a tree at ".. minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
local snow = is_snow_nearby(pos) local snow = is_snow_nearby(pos)
if mapgen == "v6" then if mg_name == "v6" then
default.grow_pine_tree(pos, snow) default.grow_pine_tree(pos, snow)
elseif snow then elseif snow then
default.grow_new_snowy_pine_tree(pos) default.grow_new_snowy_pine_tree(pos)