forked from mtcontrib/farming
plants added with farming.register_plant will add information to farming.registered_plants table
This commit is contained in:
parent
d3d1feba0e
commit
0d5fb9800a
25
init.lua
25
init.lua
@ -5,13 +5,15 @@
|
|||||||
auto-refill by crabman77
|
auto-refill by crabman77
|
||||||
]]
|
]]
|
||||||
|
|
||||||
farming = {}
|
farming = {
|
||||||
farming.mod = "redo"
|
mod = "redo",
|
||||||
farming.version = "20180617"
|
version = "20180929",
|
||||||
farming.path = minetest.get_modpath("farming")
|
path = minetest.get_modpath("farming"),
|
||||||
farming.select = {
|
select = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
|
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
|
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 info
|
||||||
return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
|
return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user