mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 22:33:16 -04:00
Dig the whole papyrus/cactus (second try)
The plant is removed from the dug node upwards and added to the players inventory.
This commit is contained in:
parent
2f91ec0f73
commit
9c3d8c0853
1 changed files with 10 additions and 0 deletions
|
@ -91,3 +91,13 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Nodes in the group plant_dig go into the diggers inventory if the node below is dug
|
||||||
|
minetest.register_on_dignode(function(pos, node, digger)
|
||||||
|
if minetest.get_item_group(node.name, "plant_dig") ~= 0 and digger ~= nil then
|
||||||
|
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
|
local nn = minetest.env:get_node(np)
|
||||||
|
if minetest.get_item_group(nn.name, "plant_dig") ~= 0 then
|
||||||
|
minetest.node_dig(np, nn, digger)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
Loading…
Add table
Reference in a new issue