diff --git a/craft.lua b/craft.lua new file mode 100644 index 0000000..e875781 --- /dev/null +++ b/craft.lua @@ -0,0 +1,62 @@ +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 = { + {'', circuit, ''}, + {body, wires, body}, + {'', battery, ''}, + } +}) + + +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'}, + } +}) diff --git a/init.lua b/init.lua index 37d234d..554eaff 100644 --- a/init.lua +++ b/init.lua @@ -29,6 +29,7 @@ function ham_radio.delete_transmitter(frequency) mod_storage:set_string(tostring(frequency), nil) end +dofile(modpath.."/craft.lua") dofile(modpath.."/transmitter.lua") dofile(modpath.."/receiver.lua") dofile(modpath.."/hud.lua") diff --git a/receiver.lua b/receiver.lua index 1bf193a..8497fb1 100644 --- a/receiver.lua +++ b/receiver.lua @@ -32,14 +32,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) return true end) -minetest.register_craft({ - output = "ham_radio:receiver", - recipe = { - {"default:glass"}, - {"default:steel_ingot"}, - {"default:glass"}, - } -}) function ham_radio:locate_transmitter(player, transmitter_pos) local player_pos = player:get_pos() diff --git a/textures/ham_radio_circuit.png b/textures/ham_radio_circuit.png new file mode 100644 index 0000000..eb8f60e Binary files /dev/null and b/textures/ham_radio_circuit.png differ diff --git a/textures/peleng_locator_inv.png b/textures/peleng_locator_inv.png deleted file mode 100644 index 85eed99..0000000 Binary files a/textures/peleng_locator_inv.png and /dev/null differ diff --git a/textures/peleng_locator_wield.png b/textures/peleng_locator_wield.png deleted file mode 100644 index acc67ca..0000000 Binary files a/textures/peleng_locator_wield.png and /dev/null differ diff --git a/transmitter.lua b/transmitter.lua index 4365c12..6832432 100644 --- a/transmitter.lua +++ b/transmitter.lua @@ -1,13 +1,4 @@ -minetest.register_craft({ - output = "ham_radio:transmitter", - recipe = { - {"default:glass"}, - {"default:mese"}, - {"default:steel_ingot"}, - } -}) - minetest.register_node("ham_radio:transmitter", { description = "Ham Radio Transmitter", tiles = {"ham_radio_transmitter_top.png", "ham_radio_transmitter.png"},