diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2018-06-17 09:55:26 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-06-17 09:55:26 +0100 |
commit | 8a4ca846d90abf5732b436c1f31b72c6b52e61dc (patch) | |
tree | b5d7ba913649ec5b95e40a5cedac717e92eea225 /api.txt | |
parent | 9d6728053aa2138e1fc77938ec4c34f89ba29542 (diff) |
added growth_check(pos, nodename) function
Diffstat (limited to 'api.txt')
-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, |