diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2018-05-17 09:25:16 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-05-17 09:25:16 +0100 |
commit | 6e52f967038bc1676723619141f6f936ca11165a (patch) | |
tree | 6f9e4c38694eb499ba183b42a97360aea70aa225 /api.txt | |
parent | 82104e68a7fe06e8c441b22dc6f0af3ac0cd9fc0 (diff) |
add api.txt and tidy code
Diffstat (limited to 'api.txt')
-rw-r--r-- | api.txt | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -0,0 +1,41 @@ +Farming API +----------- + +The farming API allows you to easily register plants and hoes. + +`farming.register_hoe(name, hoe definition)` + * Register a new hoe, see [#hoe definition] + +`farming.register_plant(name, Plant definition)` + * Register a new growing plant, see [#Plant definition] + +`farming.registered_plants[name] = definition` + * Table of registered plants, indexed by plant name + +### Hoe Definition + + + { + description = "", -- Description for tooltip + inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image + max_uses = 30, -- Uses until destroyed + material = "", -- Material for recipes + recipe = { -- Craft recipe, if material isn't used + {"air", "air", "air"}, + {"", "group:stick"}, + {"", "group:stick"}, + } + } + +### Plant definition + + { + description = "", -- Description of seed item + inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image + steps = 8, -- How many steps the plant has to grow, until it can be harvested + -- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) + minlight = 13, -- Minimum light to grow + maxlight = default.LIGHT_MAX -- Maximum light to grow + } + +Note: Any crops registered with the above function will use the new growing routines, also if crops are manually added with the {growing=1} group they will also grow. |