forked from D00Med/horror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flint_steel.lua
31 lines (27 loc) · 1009 Bytes
/
flint_steel.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if horror.override_flint_and_steel then
--flint and steel override(not included in the license since it's only changing the node placed)
if minetest.registered_items["fire:flint_and_steel"] then
minetest.override_item("fire:flint_and_steel", {
description = "Flint and Steel",
inventory_image = "fire_flint_steel.png",
on_use = function(itemstack, user, pointed_thing)
local player_name = user:get_player_name()
local pt = pointed_thing
if pt.type == "node" and minetest.get_node(pt.above).name == "air" then
itemstack:add_wear(14)
local node_under = minetest.get_node(pt.under).name
if minetest.get_item_group(node_under, "flammable") >= 1 then
if not minetest.is_protected(pt.above, player_name) then
minetest.set_node(pt.above, {name = "horror:fire"})
else
minetest.chat_send_player(player_name, "This area is protected")
end
end
end
if not minetest.setting_getbool("creative_mode") then
return itemstack
end
end
})
end
end