From: PilzAdam Date: Sun, 18 Nov 2012 16:25:43 +0000 (+0100) Subject: Don't grow papyrus into trees X-Git-Tag: 0.4.4~29 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fb8144f7039ce0c97963294132b37b52aad3e46c;p=oweals%2Fminetest_game.git Don't grow papyrus into trees --- diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 35fc0654..8b1c1440 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -69,14 +69,26 @@ end function default.make_papyrus(pos, size) for y=0,size-1 do local p = {x=pos.x, y=pos.y+y, z=pos.z} - minetest.env:set_node(p, {name="default:papyrus"}) + local nn = minetest.env:get_node(p).name + if minetest.registered_nodes[nn] and + minetest.registered_nodes[nn].buildable_to then + minetest.env:set_node(p, {name="default:papyrus"}) + else + return + end end end function default.make_cactus(pos, size) for y=0,size-1 do local p = {x=pos.x, y=pos.y+y, z=pos.z} - minetest.env:set_node(p, {name="default:cactus"}) + local nn = minetest.env:get_node(p).name + if minetest.registered_nodes[nn] and + minetest.registered_nodes[nn].buildable_to then + minetest.env:set_node(p, {name="default:cactus"}) + else + return + end end end