Fix to on_rightclick not able to change wielded_item
parent
8e69b9cb26
commit
b1019a88ba
|
@ -237,8 +237,7 @@ function minetest.item_place(itemstack, placer, pointed_thing)
|
||||||
local n = minetest.env:get_node(pointed_thing.under)
|
local n = minetest.env:get_node(pointed_thing.under)
|
||||||
local nn = n.name
|
local nn = n.name
|
||||||
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
|
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
|
||||||
minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer)
|
return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer, itemstack)
|
||||||
return
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1497,8 +1497,10 @@ Node definition (register_node)
|
||||||
on_punch = func(pos, node, puncher),
|
on_punch = func(pos, node, puncher),
|
||||||
^ default: minetest.node_punch
|
^ default: minetest.node_punch
|
||||||
^ By default: does nothing
|
^ By default: does nothing
|
||||||
on_rightclick = func(pos, node, clicker),
|
on_rightclick = func(pos, node, clicker, itemstack),
|
||||||
^ default: nil
|
^ default: nil
|
||||||
|
^ if defined, itemstack will hold clicker's wielded item
|
||||||
|
Shall return the leftover itemstack
|
||||||
on_dig = func(pos, node, digger),
|
on_dig = func(pos, node, digger),
|
||||||
^ default: minetest.node_dig
|
^ default: minetest.node_dig
|
||||||
^ By default: checks privileges, wears out tool and removes node
|
^ By default: checks privileges, wears out tool and removes node
|
||||||
|
|
Loading…
Reference in New Issue