mirror of
https://codeberg.org/tenplus1/farming.git
synced 2024-11-11 04:40:27 +01:00
update api.txt
This commit is contained in:
parent
0349a7a6f1
commit
8bd129309c
4
api.txt
4
api.txt
|
@ -20,7 +20,6 @@ The farming API allows you to easily register plants and hoes.
|
||||||
|
|
||||||
### Hoe Definition
|
### Hoe Definition
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
description = "My Hoe", -- Description for tooltip
|
description = "My Hoe", -- Description for tooltip
|
||||||
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
|
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
|
||||||
|
@ -42,6 +41,7 @@ The farming API allows you to easily register plants and hoes.
|
||||||
-- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
|
-- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
|
||||||
minlight = 13, -- Minimum light to grow
|
minlight = 13, -- Minimum light to grow
|
||||||
maxlight = minetest.LIGHT_MAX -- Maximum light to grow
|
maxlight = minetest.LIGHT_MAX -- Maximum light to grow
|
||||||
|
can_grow = function(pos) -- Called every growth tick to check if plant can grow returning True if needs are met (optional, defaults to checking for wet soil below plant).
|
||||||
}
|
}
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
@ -50,7 +50,7 @@ Note: Any crops registered with the above function will use the new growing rout
|
||||||
|
|
||||||
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'.
|
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)
|
growth_check = function(pos, [node_name])
|
||||||
-- check surrounding for jungle tree
|
-- check surrounding for jungle tree
|
||||||
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
|
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
|
||||||
return true -- place next growth stage
|
return true -- place next growth stage
|
||||||
|
|
|
@ -160,6 +160,8 @@ local def = {
|
||||||
},
|
},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
sounds = farming.sounds.node_sound_leaves_defaults(),
|
sounds = farming.sounds.node_sound_leaves_defaults(),
|
||||||
|
|
||||||
|
-- custom function to check for growing conditions, returning True when found
|
||||||
growth_check = function(pos, node_name)
|
growth_check = function(pos, node_name)
|
||||||
|
|
||||||
if minetest.find_node_near(pos, 1,
|
if minetest.find_node_near(pos, 1,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user