new craft recipes

This commit is contained in:
Serhii Mozhaiskyi 2019-12-06 17:30:45 +02:00
parent 4626d07702
commit 48f1c0406f
7 changed files with 63 additions and 17 deletions

62
craft.lua Normal file

@ -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'},
}
})

@ -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")

@ -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()

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

@ -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"},