Added Support for Mineclone2,Mineclonia,Mineclone5 closes #13

This commit is contained in:
James David Clarke 2023-12-19 19:12:29 +00:00
parent 8955264b6b
commit 30b7894dbe
No known key found for this signature in database
GPG Key ID: 9F5ECFD0E20F1C4C
13 changed files with 220 additions and 68 deletions

@ -1,4 +1,4 @@
name = microexpansion name = microexpansion
description = A storage managing solution to get an overview over all your items. description = A storage managing solution to get an overview over all your items.
depends = default optional_depends = pipeworks,basic_materials,mcl_furnaces,mcl_core
optional_depends = pipeworks,basic_materials supported_games = mineclone2,mineclonia,minetest_game

@ -4,16 +4,30 @@
local me = microexpansion local me = microexpansion
local substitute_basic_materials = microexpansion.settings.simple_craft == true or not minetest.get_modpath("basic_materials") local substitute_basic_materials = microexpansion.settings.simple_craft == true or not minetest.get_modpath("basic_materials")
local gold_wire_recipe = nil
-- [register item] Gold Wire if minetest.get_modpath("mcl_core") then
me.register_item("gold_wire", { gold_wire_recipe = {
description = "Gold Wire", { 2, {
groups = { wire = 1 }, {"mcl_core:gold_ingot", "mcl_core:stick"},
recipe = substitute_basic_materials and { {"mcl_core:stick", ""}
},
},
}
else
gold_wire_recipe = {
{ 2, { { 2, {
{"default:gold_ingot", "default:stick"}, {"default:gold_ingot", "default:stick"},
{"default:stick", ""} {"default:stick", ""}
}, },
}, },
} or nil, }
end
-- [register item] Gold Wire
me.register_item("gold_wire", {
description = "Gold Wire",
groups = { wire = 1 },
recipe = substitute_basic_materials and gold_wire_recipe or nil,
}) })

@ -4,26 +4,52 @@ local me = microexpansion
-- custom items that are used by multiple devices -- custom items that are used by multiple devices
-- [register item] Steel Infused Obsidian Ingot local steel_infused_obsidian_ingot_recipe = nil
me.register_item("steel_infused_obsidian_ingot", { local machine_casing_recipe = nil
description = "Steel Infused Obsidian Ingot",
recipe = { if minetest.get_modpath("mcl_core") then
steel_infused_obsidian_ingot_recipe = {
{ 2, {
{ "mcl_core:iron_ingot", "mcl_core:obsidian", "mcl_core:iron_ingot" },
},
},
}
machine_casing_recipe = {
{ 1, {
{"mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "mcl_copper:copper_ingot", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot"},
},
},
}
else
steel_infused_obsidian_ingot_recipe = {
{ 2, { { 2, {
{ "default:steel_ingot", "default:obsidian_shard", "default:steel_ingot" }, { "default:steel_ingot", "default:obsidian_shard", "default:steel_ingot" },
}, },
}, },
}, }
})
-- [register item] Machine Casing machine_casing_recipe = {
me.register_item("machine_casing", {
description = "Machine Casing",
recipe = {
{ 1, { { 1, {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"}, {"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
}, },
}, },
}, }
end
-- [register item] Steel Infused Obsidian Ingot
me.register_item("steel_infused_obsidian_ingot", {
description = "Steel Infused Obsidian Ingot",
recipe = steel_infused_obsidian_ingot_recipe,
})
-- [register item] Machine Casing
me.register_item("machine_casing", {
description = "Machine Casing",
recipe = machine_casing_recipe,
}) })

@ -52,15 +52,15 @@ item_transfer.register_io_device("exporter", {
connect_sides = { "left" }, connect_sides = { "left" },
recipe = { recipe = {
{ 1, { { 1, {
{"", "basic_materials:ic", "default:steel_ingot" }, {"", "basic_materials:ic", iron_ingot_ingredient },
{"", "microexpansion:cable", "group:shovel" }, {"", "microexpansion:cable", "group:shovel" },
{"", "", "default:steel_ingot" }, {"", "", iron_ingot_ingredient },
}, },
}, },
{ 1, { { 1, {
{"", "microexpansion:logic_chip", "default:steel_ingot" }, {"", "microexpansion:logic_chip", iron_ingot_ingredient },
{"", "microexpansion:cable", "group:shovel" }, {"", "microexpansion:cable", "group:shovel" },
{"", "", "default:steel_ingot" }, {"", "", iron_ingot_ingredient },
}, },
} }
}, },

@ -59,15 +59,15 @@ item_transfer.register_io_device("importer", {
connect_sides = { "left" }, connect_sides = { "left" },
recipe = { recipe = {
{ 1, { { 1, {
{"", "basic_materials:ic", "default:steel_ingot" }, {"", "basic_materials:ic", iron_ingot_ingredient },
{"", "microexpansion:cable", "group:hoe" }, {"", "microexpansion:cable", "group:hoe" },
{"", "", "default:steel_ingot" }, {"", "", iron_ingot_ingredient },
}, },
}, },
{ 1, { { 1, {
{"", "microexpansion:logic_chip", "default:steel_ingot" }, {"", "microexpansion:logic_chip", iron_ingot_ingredient },
{"", "microexpansion:cable", "group:hoe" }, {"", "microexpansion:cable", "group:hoe" },
{"", "", "default:steel_ingot" }, {"", "", iron_ingot_ingredient },
}, },
} }
}, },

@ -4,6 +4,15 @@ local module_path = microexpansion.get_module_path("item_transfer")
microexpansion.require_module("network") microexpansion.require_module("network")
-- Iron Ingot Ingredient for MineClone2
iron_ingot_ingredient = nil
if minetest.get_modpath("mcl_core") then
iron_ingot_ingredient = "mcl_core:iron_ingot"
else
iron_ingot_ingredient = "default:steel_ingot"
end
-- Load API -- Load API
dofile(module_path.."/api.lua") dofile(module_path.."/api.lua")

@ -11,7 +11,7 @@ me.register_item("upgrade_base", {
recipe = { recipe = {
{ 1, { { 1, {
{ "microexpansion:quartz_crystal" }, { "microexpansion:quartz_crystal" },
{ "default:steel_ingot" }, { iron_ingot_ingredient },
}, },
}, },
}, },

@ -4,6 +4,29 @@ local me = microexpansion
local network = me.network local network = me.network
local access_level = microexpansion.constants.security.access_levels local access_level = microexpansion.constants.security.access_levels
local ctrl_recipe = nil
if minetest.get_modpath("mcl_core") then
ctrl_recipe = {
{ 1, {
{"mcl_core:iron_ingot", "mcl_copper:copper_ingot", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "microexpansion:machine_casing", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "microexpansion:cable", "mcl_core:iron_ingot"},
},
}
}
else
ctrl_recipe = {
{ 1, {
{"default:steel_ingot", "microexpansion:steel_infused_obsidian_ingot", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:cable", "default:steel_ingot"},
},
}
}
end
-- [register node] Controller -- [register node] Controller
me.register_node("ctrl", { me.register_node("ctrl", {
description = "ME Controller", description = "ME Controller",
@ -15,14 +38,7 @@ me.register_node("ctrl", {
"ctrl_sides", "ctrl_sides",
"ctrl_sides" "ctrl_sides"
}, },
recipe = { recipe = ctrl_recipe,
{ 1, {
{"default:steel_ingot", "microexpansion:steel_infused_obsidian_ingot", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:cable", "default:steel_ingot"},
},
}
},
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
node_box = { node_box = {

@ -127,6 +127,28 @@ local function update_security(pos,_,ev)
meta:set_string("formspec", security_formspec(pos)) meta:set_string("formspec", security_formspec(pos))
end end
local security_recipe = nil
if minetest.get_modpath("mcl_core") then
security_recipe = {
{ 1, {
{"mcl_core:iron_ingot", "mcl_copper:copper_ingot", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "microexpansion:machine_casing", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "microexpansion:cable", "mcl_core:iron_ingot"},
},
}
}
else
security_recipe = {
{ 1, {
{"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:cable", "default:steel_ingot"},
},
}
}
end
-- [me chest] Register node -- [me chest] Register node
microexpansion.register_node("security", { microexpansion.register_node("security", {
description = "ME Security Terminal", description = "ME Security Terminal",
@ -139,14 +161,7 @@ microexpansion.register_node("security", {
"chest_side", "chest_side",
"security_front", "security_front",
}, },
recipe = { recipe = security_recipe,
{ 1, {
{"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:cable", "default:steel_ingot"},
},
}
},
is_ground_content = false, is_ground_content = false,
groups = { cracky = 1, me_connect = 1 }, groups = { cracky = 1, me_connect = 1 },
paramtype = "light", paramtype = "light",

@ -1,6 +1,27 @@
-- power/gen.lua -- power/gen.lua
local me = microexpansion local me = microexpansion
local fuel_fired_generator_recipe = nil
if minetest.get_modpath("mcl_core") then
fuel_fired_generator_recipe = {
{ 1, {
{ "mcl_core:iron_ingot", "mcl_furnaces:furnace", "mcl_core:iron_ingot" },
{ "mcl_core:iron_ingot", "microexpansion:machine_casing", "mcl_core:iron_ingot" },
{ "mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot" },
},
}
}
else
fuel_fired_generator_recipe = {
{ 1, {
{ "default:steel_ingot", "default:furnace", "default:steel_ingot" },
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
},
}
}
end
-- [register node] Fuel Fired Generator -- [register node] Fuel Fired Generator
me.register_machine("fuel_fired_generator", { me.register_machine("fuel_fired_generator", {
@ -14,14 +35,7 @@ me.register_machine("fuel_fired_generator", {
"machine_sides", "machine_sides",
"fuelgen_front", "fuelgen_front",
}, },
recipe = { recipe = fuel_fired_generator_recipe,
{ 1, {
{ "default:steel_ingot", "default:furnace", "default:steel_ingot" },
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
},
}
},
groups = { cracky = 1 }, groups = { cracky = 1 },
connect_sides = "machine", connect_sides = "machine",
paramtype2 = "facedir", paramtype2 = "facedir",

@ -268,6 +268,26 @@ local function update_drive(pos,_,ev)
end end
end end
if minetest.get_modpath("mcl_core") then
drive_recipe = {
{ 1, {
{"mcl_core:iron_ingot", "mcl_chests:chest", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "microexpansion:machine_casing", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "mcl_chests:chest", "mcl_core:iron_ingot"},
},
}}
else
drive_recipe = {
{ 1, {
{"default:steel_ingot", "default:chest", "default:steel_ingot" },
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot" },
{"default:steel_ingot", "default:chest", "default:steel_ingot" },
},
}
}
end
-- [me chest] Register node -- [me chest] Register node
microexpansion.register_node("drive", { microexpansion.register_node("drive", {
description = "ME Drive", description = "ME Drive",
@ -280,14 +300,7 @@ microexpansion.register_node("drive", {
"chest_side", "chest_side",
"drive_full", "drive_full",
}, },
recipe = { recipe = drive_recipe,
{ 1, {
{"default:steel_ingot", "default:chest", "default:steel_ingot" },
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot" },
{"default:steel_ingot", "default:chest", "default:steel_ingot" },
},
}
},
is_ground_content = false, is_ground_content = false,
groups = { cracky = 1, me_connect = 1 }, groups = { cracky = 1, me_connect = 1 },
paramtype = "light", paramtype = "light",

@ -2,6 +2,33 @@
--TODO: use storagecomp for crafting --TODO: use storagecomp for crafting
if minetest.get_modpath("mcl_core") then
microexpansion.register_cell("cell_1k", {
description = "1k ME Storage Cell",
capacity = 1000,
recipe = {
{ 1, {
{"moreores:tin_ingot", "mcl_copper:copper_ingot", "moreores:tin_ingot"},
{"mcl_copper:copper_ingot", "microexpansion:steel_infused_obsidian_ingot", "mcl_copper:copper_ingot"},
{"moreores:tin_ingot", "mcl_copper:copper_ingot", "moreores:tin_ingot"}
}},
}
})
microexpansion.register_cell("cell_2k", {
description = "2k ME Storage Cell",
capacity = 2000,
recipe = {
{ 1, {
{"mcl_copper:copper_ingot", "mcl_core:iron_ingot", "mcl_copper:copper_ingot"},
{"mcl_core:iron_ingot", "mcl_core:obsidian", "mcl_core:iron_ingot"},
{"mcl_copper:copper_ingot", "mcl_core:iron_ingot", "mcl_copper:copper_ingot"}
}},
{ 1, "shapeless", {"microexpansion:cell_1k", "microexpansion:cell_1k"}}
},
})
else
-- [drive] 8k -- [drive] 8k
microexpansion.register_cell("cell_1k", { microexpansion.register_cell("cell_1k", {
description = "1k ME Storage Cell", description = "1k ME Storage Cell",
@ -31,6 +58,8 @@ microexpansion.register_cell("cell_2k", {
}, },
}) })
end
-- [drive] 16k -- [drive] 16k
microexpansion.register_cell("cell_4k", { microexpansion.register_cell("cell_4k", {
description = "4k ME Storage Cell", description = "4k ME Storage Cell",

@ -82,6 +82,29 @@ local function update_chest(pos,_,ev)
meta:set_string("formspec", chest_formspec(pos, 1, "main", page_max)) meta:set_string("formspec", chest_formspec(pos, 1, "main", page_max))
end end
local term_recipe = nil
if minetest.get_modpath("mcl_core") then
term_recipe = {
{ 1, {
{"mcl_core:iron_ingot", "mcl_chests:chest", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "microexpansion:machine_casing", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot", "microexpansion:cable", "mcl_core:iron_ingot"},
},
}
}
else
term_recipe = {
{ 1, {
{"default:steel_ingot", "default:chest", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:cable", "default:steel_ingot"},
},
}
}
end
-- [me chest] Register node -- [me chest] Register node
microexpansion.register_node("term", { microexpansion.register_node("term", {
description = "ME Terminal", description = "ME Terminal",
@ -94,14 +117,7 @@ microexpansion.register_node("term", {
"chest_side", "chest_side",
"chest_front", "chest_front",
}, },
recipe = { recipe = term_recipe,
{ 1, {
{"default:steel_ingot", "default:chest", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:machine_casing", "default:steel_ingot"},
{"default:steel_ingot", "microexpansion:cable", "default:steel_ingot"},
},
}
},
is_ground_content = false, is_ground_content = false,
groups = { cracky = 1, me_connect = 1, tubedevice = 1, tubedevice_receiver = 1 }, groups = { cracky = 1, me_connect = 1, tubedevice = 1, tubedevice_receiver = 1 },
paramtype = "light", paramtype = "light",