2015-04-15 12:55:48 -05:00
|
|
|
minetest.register_tool('more_fire:lighter', {
|
|
|
|
description = 'Lighter',
|
|
|
|
inventory_image = 'more_fire_lighter.png',
|
|
|
|
stack_max = 1,
|
|
|
|
tool_capabilities = {
|
|
|
|
full_punch_interval = 1.0,
|
|
|
|
max_drop_level = 0,
|
|
|
|
groupcaps = {
|
|
|
|
flammable = {uses = 200, maxlevel = 1},
|
|
|
|
}
|
|
|
|
},
|
2015-05-29 15:00:59 -05:00
|
|
|
on_use = function(itemstack, user, pointed_thing)
|
2015-04-15 12:55:48 -05:00
|
|
|
minetest.sound_play("spark", {gain = 1.0, max_hear_distance = 32, loop = false })
|
|
|
|
if pointed_thing.type == 'node'
|
|
|
|
and string.find(minetest.get_node(pointed_thing.under).name, 'more_fire:kindling')
|
|
|
|
then
|
|
|
|
burn(pointed_thing)
|
|
|
|
itemstack:add_wear(65535/200)
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
2015-05-29 15:00:59 -05:00
|
|
|
|
|
|
|
local USES = 20
|
|
|
|
minetest.register_tool('more_fire:marker', {
|
|
|
|
description = 'chard stick',
|
|
|
|
inventory_image = 'more_fire_chard_stick.png',
|
|
|
|
stack_max = 1,
|
|
|
|
on_use = function(itemstack, user, pointed_thing)
|
|
|
|
if pointed_thing.type == 'node' then
|
|
|
|
minetest.set_node(pointed_thing.above, {name = "more_fire:marking", param2=minetest.dir_to_facedir(user:get_look_dir())})
|
|
|
|
itemstack:add_wear(65535 / (USES - 1))
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|