diff --git a/elepower_machines/crafting.lua b/elepower_machines/crafting.lua index 74c6b5e..a47ce05 100644 --- a/elepower_machines/crafting.lua +++ b/elepower_machines/crafting.lua @@ -49,7 +49,9 @@ end -- 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 local kwfound = nil for keyword,count in pairs(keywords) do @@ -57,6 +59,8 @@ for mat, data in pairs(elepd.registered_dusts) do if found then if keyword == "_ingot" and not kwfound then kwfound = found + elseif keyword == "_block" or keyword == "block" and not block_map[mat] then + block_map[mat] = data.item end -- Grind recipe for material @@ -71,6 +75,7 @@ for mat, data in pairs(elepd.registered_dusts) do -- Add dust -> ingot smelting if kwfound then + ingot_map[mat] = kwfound minetest.register_craft({ type = "cooking", recipe = data.item, @@ -100,6 +105,23 @@ elepm.register_craft({ 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 -- ------------- @@ -333,3 +355,52 @@ minetest.register_craft({ {"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"}, + } +}) diff --git a/elepower_machines/craftitems.lua b/elepower_machines/craftitems.lua new file mode 100644 index 0000000..6287da2 --- /dev/null +++ b/elepower_machines/craftitems.lua @@ -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" +}) diff --git a/elepower_machines/init.lua b/elepower_machines/init.lua index b23d0df..498810b 100644 --- a/elepower_machines/init.lua +++ b/elepower_machines/init.lua @@ -14,6 +14,7 @@ dofile(modpath.."/machines/init.lua") -- Other dofile(modpath.."/nodes.lua") +dofile(modpath.."/craftitems.lua") -- Crafting recipes dofile(modpath.."/crafting.lua") diff --git a/elepower_machines/machines/compressor.lua b/elepower_machines/machines/compressor.lua new file mode 100644 index 0000000..67acead --- /dev/null +++ b/elepower_machines/machines/compressor.lua @@ -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} +}) diff --git a/elepower_machines/machines/init.lua b/elepower_machines/machines/init.lua index 9babbd4..62387fa 100644 --- a/elepower_machines/machines/init.lua +++ b/elepower_machines/machines/init.lua @@ -22,6 +22,7 @@ dofile(mp .. "grindstone.lua") dofile(mp .. "alloy_furnace.lua") dofile(mp .. "coal_alloy_furnace.lua") dofile(mp .. "solderer.lua") +dofile(mp .. "compressor.lua") -- Other dofile(mp .. "accumulator.lua") diff --git a/elepower_machines/textures/elepower_compressor.png b/elepower_machines/textures/elepower_compressor.png new file mode 100644 index 0000000..33afaa3 Binary files /dev/null and b/elepower_machines/textures/elepower_compressor.png differ diff --git a/elepower_machines/textures/elepower_compressor_piston.png b/elepower_machines/textures/elepower_compressor_piston.png new file mode 100644 index 0000000..401d419 Binary files /dev/null and b/elepower_machines/textures/elepower_compressor_piston.png differ diff --git a/elepower_machines/textures/elepower_turbine.png b/elepower_machines/textures/elepower_turbine.png new file mode 100644 index 0000000..f2faefa Binary files /dev/null and b/elepower_machines/textures/elepower_turbine.png differ