lighter for tnt

master
Fernando Zapata 2012-09-25 19:09:55 -06:00
parent 5cd5db1811
commit 2d36ed439c
4 changed files with 43 additions and 0 deletions

0
lighter/depends.txt Normal file
View File

43
lighter/init.lua Normal file
View File

@ -0,0 +1,43 @@
--------------------------------------------------------------------------------
-- Lighter
--------------------------------------------------------------------------------
-- Easy method to create fire
--
-- (c)2012 Fernando Zapata (ZLovesPancakes, Franz.ZPT)
-- Code licensed under GNU GPLv2
-- http://www.gnu.org/licenses/gpl-2.0.html
-- Content licensed under CC BY-SA 3.0
-- http://creativecommons.org/licenses/by-sa/3.0/
-- 2012-05-01 14:22:27
--------------------------------------------------------------------------------
minetest.register_craftitem( 'lighter:flint', {
description = 'Flint',
inventory_image = 'lighter_flint.png'
})
minetest.register_tool( 'lighter:lighter', {
description = 'Flint & Steel',
inventory_image = 'lighter_lighter.png',
on_use = function( s, u, p )
if p.type ~= 'node' then return end
if minetest.env:get_node( p.under ).name == 'tnt:tnt' then
tnt.lit( p.under )
else
minetest.env:add_node( p.above,
{ name='fire:basic_flame' } )
end
s:add_wear( math.ceil(65535/30) )
return s
end
})
minetest.register_craft({
output = 'lighter:lighter',
recipe = {
{ 'default:steel_ingot', '' },
{ '', 'lighter:flint' }
}
})
----------------------------------------------------------- End of File --------

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B