diff --git a/mods/ITEMS/mcl_fire/fire_charge.lua b/mods/ITEMS/mcl_fire/fire_charge.lua index 5024796548..32e509b38a 100644 --- a/mods/ITEMS/mcl_fire/fire_charge.lua +++ b/mods/ITEMS/mcl_fire/fire_charge.lua @@ -7,6 +7,14 @@ minetest.register_craftitem("mcl_fire:fire_charge", { liquids_pointable = false, stack_max = 64, on_place = function(itemstack, user, pointed_thing) + -- Use pointed node's on_rightclick function first, if present + local node = minetest.get_node(pointed_thing.under) + if user and not user: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, user, itemstack) or itemstack + end + end + if pointed_thing.type == "node" then if minetest.get_node(pointed_thing.under).name == "mcl_tnt:tnt" then tnt.ignite(pointed_thing.under) diff --git a/mods/ITEMS/mcl_fire/flint_and_steel.lua b/mods/ITEMS/mcl_fire/flint_and_steel.lua index 8cb37b8f96..9f39c2ea64 100644 --- a/mods/ITEMS/mcl_fire/flint_and_steel.lua +++ b/mods/ITEMS/mcl_fire/flint_and_steel.lua @@ -8,6 +8,14 @@ minetest.register_tool("mcl_fire:flint_and_steel", { stack_max = 1, groups = { tool = 1 }, on_place = function(itemstack, user, pointed_thing) + -- Use pointed node's on_rightclick function first, if present + local node = minetest.get_node(pointed_thing.under) + if user and not user: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, user, itemstack) or itemstack + end + end + local idef = itemstack:get_definition() minetest.sound_play( "fire_flint_and_steel",