mirror of
https://codeberg.org/tenplus1/farming.git
synced 2025-07-16 15:20:25 +02:00
added growth_check(pos, nodename) function
This commit is contained in:
13
api.txt
13
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,
|
||||
|
Reference in New Issue
Block a user