1
0
Fork 0

Fix fire charge and flint and steel ignoring itemframe

This commit is contained in:
Wuzzy 2017-07-24 19:57:37 +02:00
parent e9070ee134
commit 979246a7c5
2 changed files with 16 additions and 0 deletions

View File

@ -7,6 +7,14 @@ minetest.register_craftitem("mcl_fire:fire_charge", {
liquids_pointable = false, liquids_pointable = false,
stack_max = 64, stack_max = 64,
on_place = function(itemstack, user, pointed_thing) 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 pointed_thing.type == "node" then
if minetest.get_node(pointed_thing.under).name == "mcl_tnt:tnt" then if minetest.get_node(pointed_thing.under).name == "mcl_tnt:tnt" then
tnt.ignite(pointed_thing.under) tnt.ignite(pointed_thing.under)

View File

@ -8,6 +8,14 @@ minetest.register_tool("mcl_fire:flint_and_steel", {
stack_max = 1, stack_max = 1,
groups = { tool = 1 }, groups = { tool = 1 },
on_place = function(itemstack, user, pointed_thing) 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() local idef = itemstack:get_definition()
minetest.sound_play( minetest.sound_play(
"fire_flint_and_steel", "fire_flint_and_steel",