Use `mcl_util.call_on_rightclick` in `on_place` callback for barrier block
This commit is contained in:
parent
b9238b4069
commit
79876635af
|
@ -199,11 +199,9 @@ minetest.register_node("mcl_core:barrier", {
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use pointed node's on_rightclick function first, if present
|
-- Use pointed node's on_rightclick function first, if present
|
||||||
local node = minetest.get_node(pointed_thing.under)
|
local new_stack = mcl_util.call_on_rightclick(itemstack, placer, pointed_thing)
|
||||||
if placer and not placer:get_player_control().sneak then
|
if new_stack then
|
||||||
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
return new_stack
|
||||||
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local name = placer:get_player_name()
|
local name = placer:get_player_name()
|
||||||
|
|
Loading…
Reference in New Issue