mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-29 18:16:27 -04:00
Allow flooding of farming crops
This commit is contained in:
parent
d99a176b69
commit
8c415b7d4d
1 changed files with 8 additions and 0 deletions
|
@ -370,6 +370,14 @@ farming.register_plant = function(name, def)
|
|||
on_timer = farming.grow_plant,
|
||||
minlight = def.minlight,
|
||||
maxlight = def.maxlight,
|
||||
floodable = true,
|
||||
on_flood = function(pos, oldnode, newnode)
|
||||
local items = minetest.get_node_drops(oldnode.name, nil)
|
||||
for j=1, #items do
|
||||
minetest.add_item(pos, ItemStack(items[j]))
|
||||
end
|
||||
return false
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue