Added craft recipes

This commit is contained in:
Pierre-Yves Rollo 2018-12-09 18:04:25 +01:00
parent e3826fa610
commit ece5251186
3 changed files with 87 additions and 1 deletions

78
crafts.lua Normal file
View File

@ -0,0 +1,78 @@
--[[
digiterms mod for Minetest - Digilines monitors using Display API / Font API
(c) Pierre-Yves Rollo
This file is part of digiterms.
signs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
signs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with signs. If not, see <http://www.gnu.org/licenses/>.
--]]
local function material_fallback(list)
for _, material in ipairs(list) do
if minetest.registered_items[material] then
return material
end
end
end
local body = material_fallback({
'homedecor:plastic_sheeting',
'default:steel_ingot',
})
local glass = material_fallback({
'xpanes:pane_flat',
'default:glass',
})
local electronic = material_fallback({
'mesecons_microcontroller:microcontroller0000',
'mesecons_luacontroller:luacontroller0000',
'default:copper_ingot',
})
local wire = 'digilines:wire_std_00000000'
print("Craft materials:")
print("Body: "..(body or "None!"))
print("Glass: "..(glass or "None!"))
print("Electronic: "..(electronic or "None!"))
print("Wire: "..(wire or "None!"))
minetest.register_craft({
output = "digiterms:lcd_monitor 1",
recipe = {
{body, electronic, ''},
{glass, material_fallback({'mesecons_materials:silicon', 'dye:black'}), ''},
{body, wire, ''}
}
})
minetest.register_craft({
output = "digiterms:cathodic_amber_monitor",
recipe = {
{body, body, ''},
{glass, 'dye:orange', electronic},
{body, body, wire}
}
})
minetest.register_craft({
output = "digiterms:cathodic_green_monitor 1",
recipe = {
{body, body, ''},
{glass, 'dye:green', electronic},
{body, body, wire}
}
})

View File

@ -1,4 +1,12 @@
display_api
font_api
digilines
dye
default
xpane?
scifi_nodes?
basic_materials?
homedecor?
mesecons_microcontroller?
mesecons_luacontroller?
mesecons_materials?

View File

@ -26,7 +26,7 @@ digiterms.font = "mozart"
dofile(digiterms.path.."/font_mozart.lua")
dofile(digiterms.path.."/functions.lua")
dofile(digiterms.path.."/nodes.lua")
--dofile(digiterms.path.."/crafts.lua")
dofile(digiterms.path.."/crafts.lua")
if minetest.get_modpath("scifi_nodes") then
print ('[digiterms] scifi_nodes present, adding some more nodes')