diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2015-05-05 22:44:22 -0700 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2015-05-05 22:44:22 -0700 |
commit | a4a53ba854114ff2cafb0fd7f76d8d81f485a306 (patch) | |
tree | 2435f39de7118b0e4a5e0b0cf1392473e8261bc9 | |
parent | 6a1946e22f04b44f356e3768016536f234d9968c (diff) |
No need to hardcode nodenames here.
-rw-r--r-- | init.lua | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -214,13 +214,14 @@ dofile(modpath .. "/tomato.lua") dofile(modpath .. "/potato.lua") dofile(modpath .. "/polebean.lua") +local nodenames = {} +for i = 1,table.getn(crops.plants) do + table.insert(nodenames, crops.plants[i].name) +end + -- water handling code minetest.register_abm({ - nodenames = { - "crops:tomato_plant_1", "crops:tomato_plant_2", "crops:tomato_plant_3", "crops:tomato_plant_4", "crops:tomato_plant_5", - "crops:potato_plant_1", "crops:potato_plant_2", "crops:potato_plant_3", "crops:potato_plant_4", - "crops:melon_plant_1", "crops:melon_plant_2", "crops:melon_plant_3", "crops:melon_plant_4", "crops:melon_plant_5" - }, + nodenames = nodenames, interval = crops.interval, chance = crops.chance, action = function(pos, node, active_object_count, active_object_count_wider) |