Add wear to flint and steel for igniting TNT

This commit is contained in:
Wuzzy 2019-09-24 04:19:24 +02:00
parent 79604bb63a
commit 8622412954

View File

@ -261,11 +261,16 @@ minetest.register_node(
if not tnt_enable then if not tnt_enable then
return return
end end
local itemname = puncher:get_wielded_item():get_name() local item = puncher:get_wielded_item()
local itemname = item:get_name()
if itemname == "default:flint_and_steel" then if itemname == "default:flint_and_steel" then
achievements.trigger_achievement(puncher, "boom") if not minetest.settings:get_bool("creative_mode") then
item:add_wear(800)
puncher:set_wielded_item(item)
end
tnt.burn(pos) tnt.burn(pos)
achievements.trigger_achievement(puncher, "boom")
end end
end, end,
on_blast = function(pos, intensity) on_blast = function(pos, intensity)