From 8a4ca846d90abf5732b436c1f31b72c6b52e61dc Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 17 Jun 2018 09:55:26 +0100 Subject: added growth_check(pos, nodename) function --- api.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'api.txt') diff --git a/api.txt b/api.txt index 042d041..ed51214 100644 --- a/api.txt +++ b/api.txt @@ -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, -- cgit v1.2.3 From 1018a558d2b92eb5cdba657c0f6367243c1b85a8 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 19 Jun 2018 18:36:00 +0100 Subject: added player checks for crop placement --- api.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'api.txt') diff --git a/api.txt b/api.txt index ed51214..eda1289 100644 --- a/api.txt +++ b/api.txt @@ -40,7 +40,6 @@ 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'. -- cgit v1.2.3