Make more items respect the node's on_rightclick
- Bone meal - Fishing rod - Seeds - Hopper - Nether wart - Sponge - Bow - Shovel
This commit is contained in:
parent
064bf1effe
commit
9cb2f5b392
8 changed files with 72 additions and 3 deletions
|
@ -46,6 +46,14 @@ function mcl_farming:place_seed(itemstack, placer, pointed_thing, plantname)
|
|||
if pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
-- Use pointed node's on_rightclick function first, if present
|
||||
local node = minetest.get_node(pt.under)
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
||||
return minetest.registered_nodes[node.name].on_rightclick(pt.under, node, placer, itemstack) or itemstack
|
||||
end
|
||||
end
|
||||
|
||||
local pos = {x=pt.above.x, y=pt.above.y-1, z=pt.above.z}
|
||||
local farmland = minetest.get_node(pos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue