light gunpowder with flint and steel

This commit is contained in:
cale 2016-03-24 11:14:22 +01:00
parent 7cba7af894
commit 7668a9e4f7

View file

@ -77,7 +77,14 @@ minetest.register_tool("fire:flint_and_steel", {
local player_name = user:get_player_name()
local pt = pointed_thing
if pt.type == "node" and minetest.get_node(pt.above).name == "air" then
if pt.type == "node" and minetest.get_node(pt.under).name == "tnt:gunpowder" then
if not minetest.is_protected(pt.under, player_name) then
minetest.set_node(pt.under, {name="tnt:gunpowder_burning"})
minetest.get_node_timer(pt.under):start(1)
else
minetest.chat_send_player(player_name, "This area is protected")
end
elseif pt.type == "node" and minetest.get_node(pt.above).name == "air" then
if not minetest.is_protected(pt.above, player_name) then
minetest.set_node(pt.above, {name="fire:basic_flame"})
else