Merge pull request #20 from JamesClarke7283/master

Added Support for Mineclone2,Mineclonia,Mineclone5 closes #13
This commit is contained in:
theFox6 2023-12-27 18:17:46 +01:00 committed by GitHub
commit 3c064d33fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 279 additions and 92 deletions

@ -27,6 +27,7 @@ function microexpansion.register_oredef(ore, defs)
for _,d in ipairs(defs) do
d.ore = ore
minetest.log("action", minetest.serialize(d))
minetest.register_ore(d)
end
end
@ -72,6 +73,13 @@ end
-- [function] Register Node
function microexpansion.register_node(itemstring, def)
if minetest.get_modpath("mcl_core") then
def._mcl_hardness = def._mcl_hardness or 3
def._mcl_blast_resistance = def._mcl_blast_resistance or 3
def._mcl_hardness = def._mcl_hardness or 3
def._mcl_silk_touch_drop = def._mcl_silk_touch_drop or true
def.groups.pickaxey = def.groups.pickaxey or 3
end
-- Check if disabled
if def.disabled == true then
return

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

@ -4,16 +4,30 @@
local me = microexpansion
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
me.register_item("gold_wire", {
description = "Gold Wire",
groups = { wire = 1 },
recipe = substitute_basic_materials and {
if minetest.get_modpath("mcl_core") then
gold_wire_recipe = {
{ 2, {
{"mcl_core:gold_ingot", "mcl_core:stick"},
{"mcl_core:stick", ""}
},
},
}
else
gold_wire_recipe = {
{ 2, {
{"default:gold_ingot", "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
-- [register item] Steel Infused Obsidian Ingot
me.register_item("steel_infused_obsidian_ingot", {
description = "Steel Infused Obsidian Ingot",
recipe = {
local steel_infused_obsidian_ingot_recipe = nil
local machine_casing_recipe = nil
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, {
{ "default:steel_ingot", "default:obsidian_shard", "default:steel_ingot" },
},
},
},
})
}
-- [register item] Machine Casing
me.register_item("machine_casing", {
description = "Machine Casing",
recipe = {
machine_casing_recipe = {
{ 1, {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:copper_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" },
recipe = {
{ 1, {
{"", "basic_materials:ic", "default:steel_ingot" },
{"", "basic_materials:ic", microexpansion.iron_ingot_ingredient },
{"", "microexpansion:cable", "group:shovel" },
{"", "", "default:steel_ingot" },
{"", "", microexpansion.iron_ingot_ingredient },
},
},
{ 1, {
{"", "microexpansion:logic_chip", "default:steel_ingot" },
{"", "microexpansion:logic_chip", microexpansion.iron_ingot_ingredient },
{"", "microexpansion:cable", "group:shovel" },
{"", "", "default:steel_ingot" },
{"", "", microexpansion.iron_ingot_ingredient },
},
}
},

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

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

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

@ -4,6 +4,17 @@ local me = microexpansion
local network = me.network
local access_level = microexpansion.constants.security.access_levels
local ctrl_recipe = nil
ctrl_recipe = {
{ 1, {
{microexpansion.iron_ingot_ingredient, "microexpansion:steel_infused_obsidian_ingot", microexpansion.iron_ingot_ingredient},
{microexpansion.iron_ingot_ingredient, "microexpansion:machine_casing", microexpansion.iron_ingot_ingredient},
{microexpansion.iron_ingot_ingredient, "microexpansion:cable", microexpansion.iron_ingot_ingredient},
},
}
}
-- [register node] Controller
me.register_node("ctrl", {
description = "ME Controller",
@ -15,14 +26,7 @@ me.register_node("ctrl", {
"ctrl_sides",
"ctrl_sides"
},
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"},
},
}
},
recipe = ctrl_recipe,
drawtype = "nodebox",
paramtype = "light",
node_box = {

@ -127,6 +127,28 @@ local function update_security(pos,_,ev)
meta:set_string("formspec", security_formspec(pos))
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
microexpansion.register_node("security", {
description = "ME Security Terminal",
@ -139,14 +161,7 @@ microexpansion.register_node("security", {
"chest_side",
"security_front",
},
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"},
},
}
},
recipe = security_recipe,
is_ground_content = false,
groups = { cracky = 1, me_connect = 1 },
paramtype = "light",

@ -1,47 +1,86 @@
-- ores/init.lua
local me = microexpansion
local mcl_core_modpath = minetest.get_modpath("mcl_core")
stone_ingrediant = mcl_core_modpath and "mcl_core:stone" or "default:stone"
-- [register] Incranium Ore
me.register_node("incranium", {
local incranium_y_min = -300
local incranium_y_max = -90
local quartz_y_min = -31000
local quartz_y_max = -5
local incranium_cracky = 3
local quartz_cracky = 3
if mcl_core_modpath then
incranium_y_min = -55
incranium_y_max = -20
quartz_y_min = -50
quartz_y_max = 0
incranium_cracky = 3
quartz_cracky = 3
end
local quartz_nodedef = {
description = "Quartz Ore",
tiles = { "default_stone.png^microexpansion_ore_quartz.png" },
is_ground_content = true,
type = "ore",
groups = {cracky=quartz_cracky,material_stone=1, stone=1, pickaxey=3},
drop = "microexpansion:quartz_crystal",
oredef = {{
ore_type = "scatter",
wherein = stone_ingrediant,
clust_scarcity = 10*10*10,
clust_num_ores = 6,
clust_size = 5,
y_min = quartz_y_min,
y_max = quartz_y_max,
}},
}
incranium_nodedef = {
description = "Incranium Ore",
tiles = { "incranium" },
is_ground_content = true,
groups = { cracky=3, stone=1 },
groups = {cracky=incranium_cracky, material_stone=1, stone=1,pickaxey=3 },
type = "ore",
oredef = {
{
ore_type = "blob",
wherein = "default:stone",
wherein = stone_ingrediant,
clust_scarcity = 4*4*4,
clust_num_ores = 4,
clust_size = 3,
y_min = -300,
y_max = -90,
y_min = incranium_y_min,
y_max = incranium_y_max,
},
},
disabled = true,
})
}
if mcl_core_modpath then
quartz_nodedef._mcl_hardness = 3
quartz_nodedef._mcl_blast_resistance = 3
quartz_nodedef._mcl_hardness = 3
quartz_nodedef._mcl_silk_touch_drop = true
quartz_nodedef._mcl_fortune_drop = mcl_core.fortune_drop_ore
incranium_nodedef._mcl_hardness = 3
incranium_nodedef._mcl_blast_resistance = 3
incranium_nodedef._mcl_hardness = 3
incranium_nodedef._mcl_silk_touch_drop = true
incranium_nodedef._mcl_fortune_drop = mcl_core.fortune_drop_ore
end
-- [register] Incranium Ore
me.register_node("incranium", incranium_nodedef)
me.register_item("quartz_crystal", {
description = "Quartz Crystal",
})
me.register_node("quartz", {
description = "Quartz Ore",
tiles = { "default_stone.png^microexpansion_ore_quartz.png" },
is_ground_content = true,
type = "ore",
groups = { cracky=3, stone=1 },
drop = "microexpansion:quartz_crystal",
oredef = {{
ore_type = "scatter",
wherein = "default:stone",
clust_scarcity = 10*10*10,
clust_num_ores = 6,
clust_size = 5,
y_min = -31000,
y_max = -5,
}}
})
me.register_node("quartz", quartz_nodedef)

@ -1,6 +1,27 @@
-- power/gen.lua
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
me.register_machine("fuel_fired_generator", {
@ -14,14 +35,7 @@ me.register_machine("fuel_fired_generator", {
"machine_sides",
"fuelgen_front",
},
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" },
},
}
},
recipe = fuel_fired_generator_recipe,
groups = { cracky = 1 },
connect_sides = "machine",
paramtype2 = "facedir",

@ -268,6 +268,26 @@ local function update_drive(pos,_,ev)
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
microexpansion.register_node("drive", {
description = "ME Drive",
@ -280,14 +300,7 @@ microexpansion.register_node("drive", {
"chest_side",
"drive_full",
},
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" },
},
}
},
recipe = drive_recipe,
is_ground_content = false,
groups = { cracky = 1, me_connect = 1 },
paramtype = "light",

@ -2,6 +2,33 @@
--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
microexpansion.register_cell("cell_1k", {
description = "1k ME Storage Cell",
@ -31,6 +58,8 @@ microexpansion.register_cell("cell_2k", {
},
})
end
-- [drive] 16k
microexpansion.register_cell("cell_4k", {
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))
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
microexpansion.register_node("term", {
description = "ME Terminal",
@ -94,14 +117,7 @@ microexpansion.register_node("term", {
"chest_side",
"chest_front",
},
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"},
},
}
},
recipe = term_recipe,
is_ground_content = false,
groups = { cracky = 1, me_connect = 1, tubedevice = 1, tubedevice_receiver = 1 },
paramtype = "light",