Mineclonia/mods/ITEMS/mcl_fire/fire_charge.lua

32 lines
1.2 KiB
Lua
Raw Normal View History

2017-02-01 15:39:51 +00:00
-- Fire Charge
minetest.register_craftitem("mcl_fire:fire_charge", {
description = "Fire Charge",
_doc_items_longdesc = "Fire charges are primarily projectiles which can be launched from dispensers, they will fly in a straight line and burst into a fire on impact. Alternatively, they can be used to ignite fires directly.",
_doc_items_usagehelp = "Put the fire charge into a dispenser and supply it with redstone power to launch it. To ignite a fire directly, simply place the fire charge on the ground, which uses it up.",
2017-02-01 15:39:51 +00:00
inventory_image = "mcl_fire_fire_charge.png",
liquids_pointable = false,
stack_max = 64,
on_place = function(itemstack, user, pointed_thing)
2017-02-01 15:39:51 +00:00
if pointed_thing.type == "node" then
if minetest.get_node(pointed_thing.under).name == "mcl_tnt:tnt" then
tnt.ignite(pointed_thing.under)
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
2017-02-01 15:39:51 +00:00
else
2017-02-01 15:43:05 +00:00
mcl_fire.set_fire(pointed_thing)
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
2017-02-01 15:39:51 +00:00
end
end
return itemstack
end,
})
minetest.register_craft({
type = 'shapeless',
output = 'mcl_fire:fire_charge 3',
2017-02-16 20:33:14 +00:00
recipe = { 'mcl_mobitems:blaze_powder', 'group:coal', 'mcl_mobitems:gunpowder' },
2017-02-01 15:39:51 +00:00
})