From 979246a7c5c2970c9885acab9212a2e1ccec3b9e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 24 Jul 2017 19:57:37 +0200 Subject: [PATCH] Fix fire charge and flint and steel ignoring itemframe --- mods/ITEMS/mcl_fire/fire_charge.lua | 8 ++++++++ mods/ITEMS/mcl_fire/flint_and_steel.lua | 8 ++++++++ 2 files changed, 16 insertions(+) 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",