add more fuels
This commit is contained in:
parent
85176eb3cd
commit
e8cacf03ff
|
@ -0,0 +1,12 @@
|
|||
|
||||
oillamps.burn_resource = {"basic_materials:oil_extract","ethereal:palm_wax","basic_materials:paraffin"}
|
||||
oillamps.bexist = false
|
||||
oillamps.existing_ressource = {}
|
||||
|
||||
-- check that at least one burning ressource exist
|
||||
for _,resource in pairs(oillamps.burn_resource) do
|
||||
oillamps.bexist = oillamps.bexist or (minetest.registered_items[resource] ~= nil)
|
||||
if (minetest.registered_items[resource]) then
|
||||
table.insert(oillamps.existing_ressource,resource)
|
||||
end
|
||||
end
|
23
crafts.lua
23
crafts.lua
|
@ -14,14 +14,19 @@ minetest.register_craft({
|
|||
cooktime = 3
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "basic_materials:oil_extract 2",
|
||||
recipe = {{"group:seed","group:seed"},{"group:seed","group:seed"}},
|
||||
})
|
||||
if minetest.registered_items["basic_materials:oil_extract"] then
|
||||
minetest.register_craft({
|
||||
output = "basic_materials:oil_extract 2",
|
||||
recipe = {{"group:seed","group:seed"},{"group:seed","group:seed"}},
|
||||
})
|
||||
end
|
||||
|
||||
-- fill an empty oil lamp with oil extract
|
||||
minetest.register_craft({
|
||||
recipe = {{"basic_materials:oil_extract"},{"oillamps:oillampempty"}},
|
||||
output = "oillamps:oillamp 1",
|
||||
})
|
||||
|
||||
for _,resource in pairs(oillamps.existing_ressource) do
|
||||
if minetest.registered_items[resource] then
|
||||
minetest.register_craft({
|
||||
recipe = {{resource},{"oillamps:oillampempty"}},
|
||||
output = "oillamps:oillamp 1",
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
11
init.lua
11
init.lua
|
@ -7,9 +7,14 @@ modname = minetest.get_current_modname(),
|
|||
|
||||
minetest.log("action", "[MOD]"..oillamps.modname.." -- start loading ")
|
||||
|
||||
dofile(oillamps.modpath .. "/nodes.lua")
|
||||
dofile(oillamps.modpath .. "/craftitems.lua")
|
||||
dofile(oillamps.modpath .. "/crafts.lua")
|
||||
dofile(oillamps.modpath .. "/config.lua")
|
||||
if(oillamps.bexist) then
|
||||
dofile(oillamps.modpath .. "/nodes.lua")
|
||||
dofile(oillamps.modpath .. "/craftitems.lua")
|
||||
dofile(oillamps.modpath .. "/crafts.lua")
|
||||
else
|
||||
minetest.log("action", "[MOD]"..oillamps.modname.." -- no ressources found -> not defining oil lamps ")
|
||||
end
|
||||
|
||||
minetest.log("action", "[MOD]"..oillamps.modname.." -- end loading ")
|
||||
|
||||
|
|
Loading…
Reference in New Issue