summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2015-05-05 22:44:22 -0700
committerAuke Kok <auke-jan.h.kok@intel.com>2015-05-05 22:44:22 -0700
commita4a53ba854114ff2cafb0fd7f76d8d81f485a306 (patch)
tree2435f39de7118b0e4a5e0b0cf1392473e8261bc9 /init.lua
parent6a1946e22f04b44f356e3768016536f234d9968c (diff)
No need to hardcode nodenames here.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/init.lua b/init.lua
index 0880299..e7982ed 100644
--- a/init.lua
+++ b/init.lua
@@ -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)