added craft recipies

This commit is contained in:
theFox6 2020-03-04 16:46:22 +01:00
parent 482eb7bebd
commit a4c0e2a759
No known key found for this signature in database
GPG Key ID: C884FE8D3BCE128A
9 changed files with 107 additions and 42 deletions

48
api.lua

@ -64,35 +64,35 @@ function microexpansion.register_item(itemstring, def)
-- Register craftitem
minetest.register_craftitem(BASENAME..":"..itemstring, def)
-- if recipe, Register recipe
if def.recipe then
microexpansion.register_recipe(BASENAME..":"..itemstring, def.recipe)
end
-- if recipe, Register recipe
if def.recipe then
microexpansion.register_recipe(BASENAME..":"..itemstring, def.recipe)
end
end
-- [function] Register Node
function microexpansion.register_node(itemstring, def)
-- Check if disabled
if def.disabled == true then
return
end
-- Set usedfor
if def.usedfor then
def.description = def.description .. "\n"..minetest.colorize("grey", def.usedfor)
end
-- Update texture
if def.auto_complete ~= false then
for _,i in ipairs(def.tiles) do
if #def.tiles[_]:split("^") <= 1 then
local prefix = ""
if def.type == "ore" then
prefix = "ore_"
end
-- Check if disabled
if def.disabled == true then
return
end
-- Set usedfor
if def.usedfor then
def.description = def.description .. "\n"..minetest.colorize("grey", def.usedfor)
end
-- Update texture
if def.auto_complete ~= false then
for i,n in ipairs(def.tiles) do
if #def.tiles[i]:split("^") <= 1 then
local prefix = ""
if def.type == "ore" then
prefix = "ore_"
end
def.tiles[_] = BASENAME.."_"..prefix..i..".png"
end
end
end
def.tiles[i] = BASENAME.."_"..prefix..n..".png"
end
end
end
-- Colour description
def.description = desc_colour(def.status, def.description)
-- Update connect_sides

@ -14,6 +14,14 @@ 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"},
},
}
},
drawtype = "nodebox",
paramtype = "light",
node_box = {
@ -75,6 +83,12 @@ me.register_machine("cable", {
tiles = {
"cable",
},
recipe = {
{ 12, "shapeless", {
"microexpansion:steel_infused_obsidian_ingot", "microexpansion:machine_casing"
},
}
},
drawtype = "nodebox",
node_box = {
type = "connected",

@ -9,7 +9,7 @@ local me = microexpansion
me.register_item("steel_infused_obsidian_ingot", {
description = "Steel Infused Obsidian Ingot",
recipe = {
{ 1, {
{ 2, {
{ "default:steel_ingot", "default:obsidian_shard", "default:steel_ingot" },
},
},

@ -24,10 +24,7 @@ function microexpansion.register_cell(itemstring, def)
-- if recipe, register recipe
if def.recipe then
-- if recipe, register recipe
if def.recipe then
microexpansion.register_recipe(BASENAME..":"..itemstring, def.recipe)
end
microexpansion.register_recipe(BASENAME..":"..itemstring, def.recipe)
end
end
@ -67,20 +64,20 @@ function microexpansion.move_inv(inv1, inv2, max)
if v:get_count() > left then
v = v:peek_item(left)
end
if tinv and tinv:room_for_item(tname, v) then
if huge then
microexpansion.insert_item(v, tinv, tname)
finv:remove_item(fname, v)
else
local leftover = tinv:add_item(tname, v)
if tinv and tinv:room_for_item(tname, v) then
if huge then
microexpansion.insert_item(v, tinv, tname)
finv:remove_item(fname, v)
else
local leftover = tinv:add_item(tname, v)
finv:remove_item(fname, v)
if leftover and not(leftover:is_empty()) then
minetest.log("warning","leftover items when transfering inventory")
finv:add_item(fname, leftover)
end
end
inserted = inserted + v:get_count()
end
end
end
finv:add_item(fname, leftover)
end
end
inserted = inserted + v:get_count()
end
end
end
end

@ -32,6 +32,14 @@ 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" },
},
}
},
is_ground_content = false,
groups = { cracky = 1, me_connect = 1 },
paramtype = "light",

@ -1,43 +1,81 @@
-- microexpansion/storage.lua
--TODO: use storagecomp for crafting
-- [drive] 8k
microexpansion.register_cell("cell_1k", {
description = "1k ME Storage Cell",
capacity = 1000,
recipe = {
{ 1, {
{"default:tin_ingot", "default:copper_ingot", "default:tin_ingot"},
{"default:copper_ingot","microexpansion:steel_infused_obsidian_ingot","default:copper_ingot"},
{"default:tin_ingot", "default:copper_ingot", "default:tin_ingot"},
},
}
},
})
-- [drive] 8k
microexpansion.register_cell("cell_2k", {
description = "2k ME Storage Cell",
capacity = 2000,
recipe = {
{ 1, {
{"default:copper_ingot","default:steel_ingot", "default:copper_ingot"},
{"default:steel_ingot", "default:obsidian_shard", "default:steel_ingot"},
{"default:copper_ingot","default:steel_ingot", "default:copper_ingot"},
},
},
{ 1, "shapeless", {"microexpansion:cell_1k","microexpansion:cell_1k"}}
},
})
-- [drive] 16k
microexpansion.register_cell("cell_4k", {
description = "4k ME Storage Cell",
capacity = 4000,
recipe = {
{ 1, "shapeless", {
"microexpansion:steel_infused_obsidian_ingot", "microexpansion:machine_casing", "microexpansion:steel_infused_obsidian_ingot"
},
},
{ 1, "shapeless", {"microexpansion:cell_2k","microexpansion:cell_2k"}}
},
})
-- [drive] 16k
microexpansion.register_cell("cell_8k", {
description = "8k ME Storage Cell",
capacity = 8000,
recipe = {
{ 1, "shapeless", {"microexpansion:cell_4k","microexpansion:cell_4k"}}
},
})
-- [drive] 32k
microexpansion.register_cell("cell_16k", {
description = "16k ME Storage Cell",
capacity = 16000,
recipe = {
{ 1, "shapeless", {"microexpansion:cell_8k","microexpansion:cell_8k"}}
},
})
-- [drive] 32k
microexpansion.register_cell("cell_32k", {
description = "32k ME Storage Cell",
capacity = 32000,
recipe = {
{ 1, "shapeless", {"microexpansion:cell_16k","microexpansion:cell_16k"}}
},
})
-- [drive] 64k
microexpansion.register_cell("cell_64k", {
description = "64k ME Storage Cell",
capacity = 64000,
recipe = {
{ 1, "shapeless", {"microexpansion:cell_32k","microexpansion:cell_32k"}}
},
})

@ -93,6 +93,14 @@ 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"},
},
}
},
is_ground_content = false,
groups = { cracky = 1, me_connect = 1 },
paramtype = "light",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 451 B