Skip to content

Commit

Permalink
Default/trees: Update to 'get_mapgen_setting()'
Browse files Browse the repository at this point in the history
  • Loading branch information
paramat committed Jul 18, 2016
1 parent f018e06 commit 1a2eb89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mods/default/trees.lua
Expand Up @@ -43,20 +43,20 @@ function default.grow_sapling(pos)
return
end

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

0 comments on commit 1a2eb89

Please sign in to comment.