diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-08-13 09:48:45 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-08-13 09:48:45 -0400 |
commit | 1adee001dd438172cd4ff7e3c6e9ca168b0bdd58 (patch) | |
tree | 10695dbfc2754b729562eacf041f0bdb56314183 /farming/api.txt | |
parent | 2fa93b219eadfcdcf8f1d472aad046fc62d5b99d (diff) | |
download | dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar.gz dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar.bz2 dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.tar.xz dreambuilder_modpack-1adee001dd438172cd4ff7e3c6e9ca168b0bdd58.zip |
update plantlife, digistuff, farming-redo, roads,
unified inventory, and fixed a few obsolete "overrides"
in the misc-overrides package.
Diffstat (limited to 'farming/api.txt')
-rw-r--r-- | farming/api.txt | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/farming/api.txt b/farming/api.txt new file mode 100644 index 0000000..eda1289 --- /dev/null +++ b/farming/api.txt @@ -0,0 +1,53 @@ +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. + +### Crop functions + +If a mod registers nodes to be used as crops using the {growing=1} group then an additional function can be used for custom growth checks instead of the standard 'are we above wet soil'. + +growth_check = function(pos, node_name) + -- check surrounding for jungle tree + if minetest.find_node_near(pos, 1, {"default:jungletree"}) then + return false -- place next growth stage + end + return true -- condition not met, skip next growth stage until next check +end, |