ham_radio/craft.lua

62 lines
1.2 KiB
Lua
Raw Normal View History

2019-12-06 16:30:45 +01:00
local circuit = 'default:mese_crystal'
local body = 'default:steel_ingot'
local wires = 'default:copper_ingot'
local glass = 'default:glass'
local antenna = wires
local battery = 'default:mese_crystal'
if minetest.get_modpath("basic_materials") then
circuit = 'basic_materials:ic'
body = 'basic_materials:plastic_sheet'
wires = 'basic_materials:copper_wire'
antenna = wires
battery = 'basic_materials:simple_energy_crystal'
end
if minetest.get_modpath("technic") then
antenna = 'technic:copper_coil'
battery = 'technic:battery'
end
minetest.register_craftitem("ham_radio:circuit", {
description = "Radio Circuit",
inventory_image = "ham_radio_circuit.png",
})
minetest.register_craft({
output = "ham_radio:circuit",
recipe = {
2019-12-07 10:42:21 +01:00
{circuit, wires, circuit},
{body, battery, body},
2019-12-06 16:30:45 +01:00
}
})
minetest.register_craft({
output = "ham_radio:receiver",
recipe = {
{antenna},
{'ham_radio:circuit'},
{body}
}
})
minetest.register_craft({
output = "ham_radio:transmitter",
recipe = {
{wires, antenna, wires},
{glass, 'ham_radio:circuit', glass},
{body, body, body}
}
})
minetest.register_craft({
output = "ham_radio:beacon",
recipe = {
{antenna, body},
{wires, 'ham_radio:circuit'},
}
})