Skip to content

Commit

Permalink
crafts and recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
nonfreegithub committed Oct 25, 2023
1 parent 3e98dcb commit 6d06f7d
Show file tree
Hide file tree
Showing 38 changed files with 274 additions and 174 deletions.
34 changes: 5 additions & 29 deletions technic/crafts.lua
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
-- check if we have the necessary dependencies to allow actually using these materials in the crafts
local mesecons_materials = minetest.get_modpath("mesecons_materials")
local has_mcl = minetest.get_modpath("mcl_core")
local has_mcl_dye = minetest.get_modpath("mcl_dye")
local has_moreores = minetest.get_modpath("moreores")

local mat = {}

if has_moreores then
mat.mithril_ingot = "moreores:mithril_ingot"
mat.silver_ingot = "moreores:silver_ingot"
elseif has_mcl then
mat.mithril_ingot = "mcl_core:lapis"
mat.silver_ingot = "mcl_core:gold_ingot"
end

mat.gold_ingot = has_mcl and "mcl_core:gold_ingot" or "default:gold_ingot"
mat.iron_ingot = has_mcl and "mcl_core:iron_ingot" or "default:iron_ingot"
mat.diamond = has_mcl and "mcl_core:diamond" or "default:diamond"
mat.dirt = has_mcl and "mcl_core:dirt" or "default:dirt"
mat.tin_ingot = has_mcl and "mcl_core:iron_ingot" or "default:tin_ingot"
mat.bronze_ingot = has_mcl and "mcl_copper:copper_ingot" or "default:bronze_ingot"
mat.mese_crystal = has_mcl and "mesecons:redstone" or "default:mese_crystal"
mat.dye_green = has_mcl_dye and "mcl_dye:green" or "dye:green"
mat.dye_red = has_mcl_dye and "mcl_dye:red" or "dye:red"
mat.dye_blue = has_mcl_dye and "mcl_dye:blue" or "dye:blue"
local mat = technic.materials
local has_mcl = minetest.get_modpath("mcl_core")

-- Remove some recipes
-- Bronze
Expand Down Expand Up @@ -136,12 +114,10 @@ minetest.register_craft({
},
})

local isolation = mesecons_materials and "mesecons_materials:fiber" or "technic:rubber"

minetest.register_craft({
output = 'technic:lv_transformer',
recipe = {
{isolation, 'technic:wrought_iron_ingot', isolation},
{mat.isolation, 'technic:wrought_iron_ingot', mat.isolation},
{'technic:copper_coil', 'technic:wrought_iron_ingot', 'technic:copper_coil'},
{'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot'},
}
Expand All @@ -150,7 +126,7 @@ minetest.register_craft({
minetest.register_craft({
output = 'technic:mv_transformer',
recipe = {
{isolation, 'technic:carbon_steel_ingot', isolation},
{mat.isolation, 'technic:carbon_steel_ingot', mat.isolation},
{'technic:copper_coil', 'technic:carbon_steel_ingot', 'technic:copper_coil'},
{'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot'},
}
Expand All @@ -159,7 +135,7 @@ minetest.register_craft({
minetest.register_craft({
output = 'technic:hv_transformer',
recipe = {
{isolation, 'technic:stainless_steel_ingot', isolation},
{mat.isolation, 'technic:stainless_steel_ingot', mat.isolation},
{'technic:copper_coil', 'technic:stainless_steel_ingot', 'technic:copper_coil'},
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
}
Expand Down
3 changes: 3 additions & 0 deletions technic/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ technic.modpath = modpath
local S = minetest.get_translator("technic")
technic.getter = S

-- Read materials file
dofile(modpath.."/materials.lua")

-- Read configuration file
dofile(modpath.."/config.lua")

Expand Down
6 changes: 4 additions & 2 deletions technic/machines/HV/forcefield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ local S = technic.getter

local cable_entry = "^technic_cable_connection_overlay.png"

local mat = technic.materials

minetest.register_craft({
output = "technic:forcefield_emitter_off",
recipe = {
{"default:mese", "basic_materials:motor", "default:mese" },
{mat.mese, "basic_materials:motor", mat.mese },
{"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"},
{"default:mese", "technic:hv_cable", "default:mese" },
{mat.mese, "technic:hv_cable", mat.mese },
}
})

Expand Down
3 changes: 2 additions & 1 deletion technic/machines/HV/nuclear_reactor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local fuel_type = "technic:uranium_fuel" -- The reactor burns this
local digiline_meltdown = technic.config:get_bool("enable_nuclear_reactor_digiline_selfdestruct")
local has_digilines = minetest.get_modpath("digilines")
local has_mcl = minetest.get_modpath("mcl_core")
local mat = technic.materials

local S = technic.getter

Expand All @@ -25,7 +26,7 @@ local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_craft({
output = 'technic:hv_nuclear_reactor_core',
recipe = {
{'technic:carbon_plate', 'default:obsidian_glass', 'technic:carbon_plate'},
{'technic:carbon_plate', mat.obsidian_glass, 'technic:carbon_plate'},
{'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'},
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
}
Expand Down
7 changes: 4 additions & 3 deletions technic/machines/LV/alloy_furnace.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
-- LV Alloy furnace
local S = technic.getter
local mat = technic.materials

-- FIXME: kpoppel: I'd like to introduce an induction heating element here...
minetest.register_craft({
output = 'technic:lv_alloy_furnace',
recipe = {
{'default:brick', 'default:brick', 'default:brick'},
{'default:brick', 'technic:machine_casing', 'default:brick'},
{'default:brick', 'technic:lv_cable', 'default:brick'},
{mat.brick, mat.brick, mat.brick},
{mat.brick, 'technic:machine_casing', mat.brick},
{mat.brick, 'technic:lv_cable', mat.brick},
}
})

Expand Down
7 changes: 4 additions & 3 deletions technic/machines/LV/cables.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
local S = technic.getter
local mat = technic.materials

minetest.register_alias("lv_cable", "technic:lv_cable")

minetest.register_craft({
output = 'technic:lv_cable 6',
recipe = {
{'default:paper', 'default:paper', 'default:paper'},
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
{'default:paper', 'default:paper', 'default:paper'},
{mat.paper, mat.paper, mat.paper},
{mat.copper_ingot, mat.copper_ingot, mat.copper_ingot},
{mat.paper, mat.paper, mat.paper},
}
})

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/compressor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ minetest.register_alias("compressor", "technic:lv_compressor")
minetest.register_craft({
output = 'technic:lv_compressor',
recipe = {
{'default:stone', 'basic_materials:motor', 'default:stone'},
{'group:stone', 'basic_materials:motor', 'group:stone'},
{'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'},
{'basic_materials:silver_wire', 'technic:lv_cable', 'basic_materials:silver_wire'},
},
Expand Down
6 changes: 3 additions & 3 deletions technic/machines/LV/electric_furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ local S = technic.getter
minetest.register_craft({
output = 'technic:electric_furnace',
recipe = {
{'default:cobble', 'default:cobble', 'default:cobble'},
{'default:cobble', 'technic:machine_casing', 'default:cobble'},
{'default:cobble', 'technic:lv_cable', 'default:cobble'},
{'group:cobble', 'group:cobble', 'group:cobble'},
{'group:cobble', 'technic:machine_casing', 'group:cobble'},
{'group:cobble', 'technic:lv_cable', 'group:cobble'},
}
})

Expand Down
8 changes: 5 additions & 3 deletions technic/machines/LV/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
-- Inefficient and expensive in fuel (200EU per tick)
-- Also only allows for LV machinery to run.

local mat = technic.materials

minetest.register_alias("lv_generator", "technic:lv_generator")

minetest.register_craft({
output = 'technic:lv_generator',
recipe = {
{'default:stone', 'default:furnace', 'default:stone'},
{'default:stone', 'technic:machine_casing', 'default:stone'},
{'default:stone', 'technic:lv_cable', 'default:stone'},
{'group:stone', mat.furnace, 'group:stone'},
{'group:stone', 'technic:machine_casing', 'group:stone'},
{'group:stone', 'technic:lv_cable', 'group:stone'},
}
})

Expand Down
7 changes: 4 additions & 3 deletions technic/machines/LV/geothermal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
minetest.register_alias("geothermal", "technic:geothermal")

local S = technic.getter
local mat = technic.materials

minetest.register_craft({
output = 'technic:geothermal',
recipe = {
{'technic:granite', 'default:diamond', 'technic:granite'},
{'technic:granite', mat.diamond, 'technic:granite'},
{'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'},
{'technic:granite', 'technic:lv_cable', 'technic:granite'},
},
Expand All @@ -26,8 +27,8 @@ minetest.register_craftitem("technic:geothermal", {

local check_node_around = function(pos)
local node = minetest.get_node(pos)
if node.name == "default:water_source" or node.name == "default:water_flowing" then return 1 end
if node.name == "default:lava_source" or node.name == "default:lava_flowing" then return 2 end
if node.name == "default:water_source" or node.name == "default:water_flowing" or node.name == "mcl_core:water_source" or node.name == "mcl_core:water_flowing" then return 1 end
if node.name == "default:lava_source" or node.name == "default:lava_flowing" or node.name == "mcl_core:lava_source" or node.name == "mcl_core:lava_flowing" then return 2 end
return 0
end

Expand Down
7 changes: 4 additions & 3 deletions technic/machines/LV/grinder.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
local S = technic.getter
local mat = technic.materials

minetest.register_alias("grinder", "technic:lv_grinder")
minetest.register_craft({
output = 'technic:lv_grinder',
recipe = {
{'default:desert_stone', 'default:diamond', 'default:desert_stone'},
{'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'},
{'technic:granite', 'technic:lv_cable', 'technic:granite'},
{mat.desert_stone, mat.diamond, mat.desert_stone},
{mat.desert_stone, 'technic:machine_casing', mat.desert_stone},
{'technic:granite', 'technic:lv_cable', 'technic:granite'},
}
})

Expand Down
3 changes: 2 additions & 1 deletion technic/machines/LV/lamp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- Illuminates a 7x7x3(H) volume below itself with light bright as the sun.

local S = technic.getter
local mat = technic.materials

local demand = 50
local desc = S("@1 Lamp", S("LV"))
Expand Down Expand Up @@ -194,7 +195,7 @@ technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver)
minetest.register_craft({
output = "technic:lv_lamp",
recipe = {
{"default:glass", "default:glass", "default:glass"},
{mat.glass, mat.glass, mat.glass},
{"technic:lv_led", "technic:lv_led", "technic:lv_led"},
{"mesecons_materials:glue", "technic:lv_cable", "mesecons_materials:glue"},
}
Expand Down
7 changes: 4 additions & 3 deletions technic/machines/LV/music_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
-- The player can play music. But it is high ampage!

local S = technic.getter
local mat = technic.materials

minetest.register_alias("music_player", "technic:music_player")
minetest.register_craft({
output = 'technic:music_player',
recipe = {
{'technic:chromium_ingot', 'default:diamond', 'technic:chromium_ingot'},
{'default:diamond', 'technic:machine_casing', 'default:diamond'},
{'default:mossycobble', 'technic:lv_cable', 'default:mossycobble'},
{'technic:chromium_ingot', mat.diamond, 'technic:chromium_ingot'},
{mat.diamond, 'technic:machine_casing', mat.diamond},
{mat.mossycobble, 'technic:lv_cable', mat.mossycobble},
}
})

Expand Down
7 changes: 5 additions & 2 deletions technic/machines/LV/water_mill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- It is a little over half as good as the thermal generator.

local S = technic.getter
local mat = technic.materials

local cable_entry = "^technic_cable_connection_overlay.png"

Expand All @@ -11,7 +12,7 @@ minetest.register_alias("water_mill", "technic:water_mill")
minetest.register_craft({
output = 'technic:water_mill',
recipe = {
{'technic:marble', 'default:diamond', 'technic:marble'},
{'technic:marble', mat.diamond, 'technic:marble'},
{'group:wood', 'technic:machine_casing', 'group:wood'},
{'technic:marble', 'technic:lv_cable', 'technic:marble'},
}
Expand All @@ -20,7 +21,9 @@ minetest.register_craft({
local function check_node_around_mill(pos)
local node = minetest.get_node(pos)
if node.name == "default:water_flowing"
or node.name == "default:river_water_flowing" then
or node.name == "default:river_water_flowing"
or node.name == "mcl_core:water_flowing"
or node.name == "mclx_core:river_water_flowing" then
return node.param2 -- returns approx. water flow, if any
end
return false
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/MV/freezer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ minetest.register_craft({
output = 'technic:mv_freezer',
recipe = {
{'technic:stainless_steel_ingot', 'technic:motor', 'technic:stainless_steel_ingot'},
{'pipeworks:pipe_1_empty', 'technic:mv_transformer', 'pipeworks:pipe_1_empty'},
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
Expand Down
5 changes: 3 additions & 2 deletions technic/machines/MV/tool_workshop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
minetest.register_alias("tool_workshop", "technic:tool_workshop")

local S = technic.getter
local mat = technic.materials

local tube_entry = "^pipeworks_tube_connection_wooden.png"

minetest.register_craft({
output = 'technic:tool_workshop',
recipe = {
{'group:wood', 'default:diamond', 'group:wood'},
{'group:wood', mat.diamond, 'group:wood'},
{'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'},
{'default:obsidian', 'technic:mv_cable', 'default:obsidian'},
{mat.obsidian, 'technic:mv_cable', mat.obsidian},
}
})

Expand Down
7 changes: 4 additions & 3 deletions technic/machines/other/coal_alloy_furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
-- Fuel driven alloy furnace. This uses no EUs:

local S = technic.getter
local mat = technic.materials

minetest.register_craft({
output = 'technic:coal_alloy_furnace',
recipe = {
{'default:brick', 'default:brick', 'default:brick'},
{'default:brick', '', 'default:brick'},
{'default:brick', 'default:brick', 'default:brick'},
{mat.brick, mat.brick, mat.brick},
{mat.brick, '', mat.brick},
{mat.brick, mat.brick, mat.brick},
}
})

Expand Down
4 changes: 3 additions & 1 deletion technic/machines/other/injector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ local fs_helpers = pipeworks.fs_helpers

local tube_entry = "^pipeworks_tube_connection_metallic.png"

local mat = technic.materials

local param2_to_under = {
[0] = {x= 0,y=-1,z= 0}, [1] = {x= 0,y= 0,z=-1},
[2] = {x= 0,y= 0,z= 1}, [3] = {x=-1,y= 0,z= 0},
Expand Down Expand Up @@ -142,7 +144,7 @@ minetest.register_craft({
output = "technic:injector 1",
recipe = {
{"", "technic:control_logic_unit",""},
{"", "default:chest",""},
{"", mat.chest,""},
{"", "pipeworks:tube_1",""},
}
})
Expand Down
3 changes: 2 additions & 1 deletion technic/machines/power_monitor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- similarly to the old "slave" switching stations.

local S = technic.getter
local mat = technic.materials

local cable_entry = "^technic_cable_connection_overlay.png"

Expand Down Expand Up @@ -43,7 +44,7 @@ minetest.register_craft({
output = "technic:power_monitor",
recipe = {
{"", "", ""},
{"", "technic:machine_casing", "default:copper_ingot"},
{"", "technic:machine_casing", mat.copper_ingot},
{"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"}
}
})
Expand Down
Loading

0 comments on commit 6d06f7d

Please sign in to comment.