diff options
author | tenplus1 <tenplus1@users.noreply.github.com> | 2018-06-17 10:01:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-17 10:01:19 +0100 |
commit | 48422e26c9f7bc50eb2d70601230172c842410ea (patch) | |
tree | f78f56838334c598c646f46438b367bee7e8ed48 | |
parent | b11eb1c0057a40176b2d4c95b7a97561e3146df5 (diff) |
Update api.txt
add growth_check(pos, nodename) function
-rw-r--r-- | api.txt | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -39,3 +39,16 @@ The farming API allows you to easily register plants and hoes. } 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, + |