From 79876635af48a23a1f2383718a7355b467552828 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 4 Dec 2022 18:45:05 +0100 Subject: [PATCH] Use `mcl_util.call_on_rightclick` in `on_place` callback for barrier block --- mods/ITEMS/mcl_core/nodes_misc.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index d6120f665..32f4a4f4d 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -199,11 +199,9 @@ minetest.register_node("mcl_core:barrier", { end -- Use pointed node's on_rightclick function first, if present - local node = minetest.get_node(pointed_thing.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(pointed_thing.under, node, placer, itemstack) or itemstack - end + local new_stack = mcl_util.call_on_rightclick(itemstack, placer, pointed_thing) + if new_stack then + return new_stack end local name = placer:get_player_name()