forked from mtcontrib/plantlife_modpack
allow random_facedir parameter during mapgen call
This commit is contained in:
parent
0f20658a2a
commit
9c7e96dd62
3
API.txt
3
API.txt
@ -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
|
||||||
|
@ -286,8 +286,12 @@ function plantslib:generate_block_with_air_checking(minp, maxp, blockseed)
|
|||||||
plantslib:generate_tree(pos, node_or_function_or_model)
|
plantslib:generate_tree(pos, node_or_function_or_model)
|
||||||
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)
|
||||||
@ -402,8 +406,12 @@ function plantslib:generate_block_no_air_check(minp, maxp, blockseed)
|
|||||||
plantslib:generate_tree(pos, node_or_function_or_model)
|
plantslib:generate_tree(pos, node_or_function_or_model)
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user