Merge branch 'api-tweak'

This commit is contained in:
Vanessa Ezekowitz 2014-08-21 01:06:52 -04:00
commit a60f89a8a2
2 changed files with 14 additions and 5 deletions

View File

@ -331,7 +331,8 @@ biome = {
-- empty region above the spawn target. -- empty region above the spawn target.
-- Useful when adding trees to snow biomes. -- Useful when adding trees to snow biomes.
-- Defaults to false. -- Defaults to false.
spawn_replace_node = bool -- same as with the ABM spawner. spawn_replace_node = bool, -- same as with the ABM spawner.
random_facedir = {table}, -- same as with the ABM spawner.
} }
Regarding node_or_function_or_treedef, this must either be table with an Regarding node_or_function_or_treedef, this must either be table with an

View File

@ -287,7 +287,11 @@ function plantslib:generate_block_with_air_checking(minp, maxp, blockseed)
spawned = true spawned = true
elseif objtype == "string" and elseif objtype == "string" and
minetest.registered_nodes[node_or_function_or_model] then minetest.registered_nodes[node_or_function_or_model] then
minetest.set_node(p_top, { name = node_or_function_or_model }) local fdir = nil
if biome.random_facedir then
fdir = math.random(biome.random_facedir[1], biome.random_facedir[2])
end
minetest.set_node(p_top, { name = node_or_function_or_model, param2 = fdir })
spawned = true spawned = true
elseif objtype == "function" then elseif objtype == "function" then
node_or_function_or_model(pos) node_or_function_or_model(pos)
@ -403,7 +407,11 @@ function plantslib:generate_block_no_air_check(minp, maxp, blockseed)
spawned = true spawned = true
elseif objtype == "string" and elseif objtype == "string" and
minetest.registered_nodes[node_or_function_or_model] then minetest.registered_nodes[node_or_function_or_model] then
minetest.set_node(p_top, { name = node_or_function_or_model }) local fdir = nil
if biome.random_facedir then
fdir = math.random(biome.random_facedir[1], biome.random_facedir[2])
end
minetest.set_node(p_top, { name = node_or_function_or_model, param2 = fdir })
spawned = true spawned = true
elseif objtype == "function" then elseif objtype == "function" then
node_or_function_or_model(pos) node_or_function_or_model(pos)