diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-06-16 21:00:19 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-06-16 21:07:38 +0200 |
commit | a1a2ac7954e09b3c53c4f0ce1a7f88abf631afcd (patch) | |
tree | 05abbe37e06e78e5458888256f51813ab6661829 /games | |
parent | 7a90b31b30897c99adcbef0a6ea0c69f1c99c2b1 (diff) | |
download | minetest-a1a2ac7954e09b3c53c4f0ce1a7f88abf631afcd.tar.gz minetest-a1a2ac7954e09b3c53c4f0ce1a7f88abf631afcd.tar.bz2 minetest-a1a2ac7954e09b3c53c4f0ce1a7f88abf631afcd.zip |
Simpler patch for saplings trying to grow on unknown nodes
Diffstat (limited to 'games')
-rw-r--r-- | games/minimal/mods/default/init.lua | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index c51af594f..1adc8f457 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -1670,13 +1670,10 @@ minetest.register_abm({ interval = 10, chance = 50, action = function(pos, node) - local node_under = minetest.registered_nodes[ - minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name] - if not node_under then + if minetest.get_item_group(minetest.get_node( + {x = pos.x, y = pos.y - 1, z = pos.z}).name, "soil") == 0 then return end - local is_soil = node_under.groups.soil - if is_soil == nil or is_soil == 0 then return end print("A sapling grows into a tree at "..minetest.pos_to_string(pos)) local vm = minetest.get_voxel_manip() local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16}) |