Add compressor, plate recipes and turbine recipe

This commit is contained in:
Evert Prants 2018-07-29 13:23:32 +03:00
parent 017255cc1f
commit ea58027dad
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
8 changed files with 101 additions and 1 deletions

View File

@ -49,7 +49,9 @@ end
-- Grinding -- -- Grinding --
-------------- --------------
local keywords = { _ingot = 1, _lump = 2, _block = 9, block = 9 } local keywords = { _ingot = 1, _lump = 2, _block = 9, block = 9 }
local ingot_map = {}
local block_map = {}
for mat, data in pairs(elepd.registered_dusts) do for mat, data in pairs(elepd.registered_dusts) do
local kwfound = nil local kwfound = nil
for keyword,count in pairs(keywords) do for keyword,count in pairs(keywords) do
@ -57,6 +59,8 @@ for mat, data in pairs(elepd.registered_dusts) do
if found then if found then
if keyword == "_ingot" and not kwfound then if keyword == "_ingot" and not kwfound then
kwfound = found kwfound = found
elseif keyword == "_block" or keyword == "block" and not block_map[mat] then
block_map[mat] = data.item
end end
-- Grind recipe for material -- Grind recipe for material
@ -71,6 +75,7 @@ for mat, data in pairs(elepd.registered_dusts) do
-- Add dust -> ingot smelting -- Add dust -> ingot smelting
if kwfound then if kwfound then
ingot_map[mat] = kwfound
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
recipe = data.item, recipe = data.item,
@ -100,6 +105,23 @@ elepm.register_craft({
time = 18, time = 18,
}) })
-----------------
-- Compressing --
-----------------
for mat, ingot in pairs(ingot_map) do
local plate = "elepower_dynamics:" .. mat .. "_plate"
if minetest.registered_items[plate] then
elepm.register_craft({
type = "compress",
recipe = { ingot .. " 2" },
output = plate,
time = 4,
})
end
end
------------- -------------
-- Sawmill -- -- Sawmill --
------------- -------------
@ -333,3 +355,52 @@ minetest.register_craft({
{"elepower_dynamics:invar_gear", "elepower_dynamics:servo_valve", "elepower_dynamics:invar_gear"}, {"elepower_dynamics:invar_gear", "elepower_dynamics:servo_valve", "elepower_dynamics:invar_gear"},
}, },
}) })
-- Compressor Piston
minetest.register_craft({
output = "elepower_machines:compressor_piston",
recipe = {
{"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""},
{"default:bronze_ingot", "default:bronze_ingot", "default:bronze_ingot"},
}
})
minetest.register_craft({
output = "elepower_machines:compressor_piston",
recipe = {
{"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""},
{"", "elepower_dynamics:bronze_plate", ""},
}
})
-- Compressor
minetest.register_craft({
output = "elepower_machines:compressor",
recipe = {
{"elepower_dynamics:integrated_circuit", "elepower_machines:compressor_piston", "elepower_dynamics:wound_copper_coil"},
{"elepower_dynamics:steel_gear", "elepower_machines:machine_block", "elepower_dynamics:steel_gear"},
{"default:steel_ingot", "elepower_machines:compressor_piston", "default:steel_ingot"},
}
})
-- Turbine blades
minetest.register_craft({
output = "elepower_machines:turbine_blades",
recipe = {
{"elepower_dynamics:steel_plate", "elepower_dynamics:steel_plate", "elepower_dynamics:steel_plate"},
{"elepower_dynamics:steel_plate", "default:steel_ingot", "elepower_dynamics:steel_plate"},
{"elepower_dynamics:steel_plate", "elepower_dynamics:steel_plate", "elepower_dynamics:steel_plate"},
}
})
-- Steam Turbine
minetest.register_craft({
output = "elepower_machines:steam_turbine",
recipe = {
{"elepower_dynamics:induction_coil", "elepower_machines:turbine_blades", "elepower_dynamics:induction_coil"},
{"elepower_dynamics:steel_plate", "elepower_machines:machine_block", "elepower_dynamics:steel_plate"},
{"elepower_dynamics:invar_gear", "elepower_machines:turbine_blades", "elepower_dynamics:invar_gear"},
}
})

View File

@ -0,0 +1,10 @@
minetest.register_craftitem("elepower_machines:compressor_piston", {
description = "Compressor Piston",
inventory_image = "elepower_compressor_piston.png"
})
minetest.register_craftitem("elepower_machines:turbine_blades", {
description = "Turbine Blades",
inventory_image = "elepower_turbine.png"
})

View File

@ -14,6 +14,7 @@ dofile(modpath.."/machines/init.lua")
-- Other -- Other
dofile(modpath.."/nodes.lua") dofile(modpath.."/nodes.lua")
dofile(modpath.."/craftitems.lua")
-- Crafting recipes -- Crafting recipes
dofile(modpath.."/crafting.lua") dofile(modpath.."/crafting.lua")

View File

@ -0,0 +1,17 @@
elepm.register_craft_type("compress", {
description = "Compressing",
inputs = 1,
})
elepm.register_crafter("elepower_machines:compressor", {
description = "Compressor",
craft_type = "compress",
ele_usage = 32,
tiles = {
"elepower_machine_top.png^elepower_power_port.png", "elepower_machine_base.png^elepower_power_port.png",
"elepower_compressor.png", "elepower_compressor.png", "elepower_compressor.png", "elepower_compressor.png",
},
ele_no_automatic_ports = true,
groups = {oddly_breakable_by_hand = 1}
})

View File

@ -22,6 +22,7 @@ dofile(mp .. "grindstone.lua")
dofile(mp .. "alloy_furnace.lua") dofile(mp .. "alloy_furnace.lua")
dofile(mp .. "coal_alloy_furnace.lua") dofile(mp .. "coal_alloy_furnace.lua")
dofile(mp .. "solderer.lua") dofile(mp .. "solderer.lua")
dofile(mp .. "compressor.lua")
-- Other -- Other
dofile(mp .. "accumulator.lua") dofile(mp .. "accumulator.lua")

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB