summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-09-29 16:17:28 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-09-29 16:17:28 +0100
commit0d5fb9800aec6399f7939d0b6f58fa5186d086b5 (patch)
treef1df6b5f00f03947c7555214df23b4b0e4f06bac /init.lua
parentd3d1feba0e3f153a99a234487835869a8bde6585 (diff)
plants added with farming.register_plant will add information to farming.registered_plants table
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua25
1 files changed, 18 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index 038ba6d..ba5747a 100644
--- a/init.lua
+++ b/init.lua
@@ -5,13 +5,15 @@
auto-refill by crabman77
]]
-farming = {}
-farming.mod = "redo"
-farming.version = "20180617"
-farming.path = minetest.get_modpath("farming")
-farming.select = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
+farming = {
+ mod = "redo",
+ version = "20180929",
+ path = minetest.get_modpath("farming"),
+ select = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
+ },
+ registered_plants = {}
}
@@ -581,6 +583,15 @@ farming.register_plant = function(name, def)
})
end
+-- add to farming.registered_plants
+farming.registered_plants[mname .. ":" .. pname] = {
+ name = mname .. ":" .. pname,
+ seed = mname .. ":seed_" .. pname,
+ steps = def.steps,
+ minlight = def.minlight,
+ maxlight = def.maxlight
+}
+print(dump(farming.registered_plants[mname .. ":" .. pname]))
-- Return info
return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
end