1
0
mirror of https://github.com/pyrollo/digiterms.git synced 2024-11-11 12:40:36 +01:00
digiterms/crafts.lua

112 lines
2.5 KiB
Lua
Raw Normal View History

2018-12-09 18:04:25 +01:00
--[[
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',
})
2018-12-13 21:52:09 +01:00
local button = material_fallback({
'mesecons_button:button_off',
'default:stone',
})
2018-12-09 18:04:25 +01:00
2018-12-13 21:52:09 +01:00
local wire = 'digilines:wire_std_00000000'
2018-12-09 18:04:25 +01:00
minetest.register_craft({
output = "digiterms:lcd_monitor 1",
recipe = {
{body, electronic, ''},
{glass, material_fallback({'mesecons_materials:silicon', 'dye:black'}), ''},
{body, wire, ''}
}
})
minetest.register_craft({
2018-12-13 21:52:09 +01:00
output = "digiterms:cathodic_beige_monitor",
2018-12-09 18:04:25 +01:00
recipe = {
2018-12-13 21:52:09 +01:00
{body, body, 'dye:yellow'},
2018-12-09 18:04:25 +01:00
{glass, 'dye:orange', electronic},
{body, body, wire}
}
})
minetest.register_craft({
2018-12-13 21:52:09 +01:00
output = "digiterms:cathodic_white_monitor",
2018-12-09 18:04:25 +01:00
recipe = {
2018-12-13 21:52:09 +01:00
{body, body, 'dye:white'},
2018-12-09 18:04:25 +01:00
{glass, 'dye:green', electronic},
{body, body, wire}
}
})
2018-12-13 21:52:09 +01:00
minetest.register_craft({
output = "digiterms:cathodic_black_monitor",
recipe = {
{body, body, 'dye:black'},
{glass, 'dye:white', electronic},
{body, body, wire}
}
})
minetest.register_craft({
output = "digiterms:beige_keyboard",
recipe = {
{button, button, 'dye:yellow'},
{body, body, wire}
}
})
minetest.register_craft({
output = "digiterms:white_keyboard",
recipe = {
{button, button, 'dye:white'},
{body, body, wire}
}
})
minetest.register_craft({
output = "digiterms:black_keyboard",
recipe = {
{button, button, 'dye:black'},
{body, body, wire}
}
})