craftguide result count
This commit is contained in:
parent
d1f9449b84
commit
2ce8339f6f
@ -4,6 +4,10 @@ local have_cg = minetest.get_modpath("craftguide") and craftguide and craftguide
|
|||||||
elepm.craft = {}
|
elepm.craft = {}
|
||||||
elepm.craft.types = {}
|
elepm.craft.types = {}
|
||||||
|
|
||||||
|
local function item_string( ... )
|
||||||
|
-- body
|
||||||
|
end
|
||||||
|
|
||||||
function elepm.register_craft_type(name, def)
|
function elepm.register_craft_type(name, def)
|
||||||
elepm.craft.types[name] = {
|
elepm.craft.types[name] = {
|
||||||
inputs = def.inputs or 2,
|
inputs = def.inputs or 2,
|
||||||
@ -78,16 +82,13 @@ function elepm.register_craft(craftdef)
|
|||||||
|
|
||||||
if have_ui or have_cg then
|
if have_ui or have_cg then
|
||||||
local spec = {}
|
local spec = {}
|
||||||
|
local items = {}
|
||||||
|
|
||||||
for item, count in pairs(recipe.recipe) do
|
for item, count in pairs(recipe.recipe) do
|
||||||
spec[#spec+1] = ItemStack(item .. " " .. count)
|
local stack = ItemStack(item)
|
||||||
end
|
stack:set_count(count)
|
||||||
|
spec[#spec+1] = stack
|
||||||
local items = {}
|
items[#items+1] = stack:to_string()
|
||||||
for itm,q in pairs(recipe.recipe) do
|
|
||||||
local itmn = itm
|
|
||||||
if q > 1 then itmn = itmn .. " " .. q end
|
|
||||||
items[#items+1] = itmn
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(recipe.output) == "table" then
|
if type(recipe.output) == "table" then
|
||||||
@ -102,13 +103,10 @@ function elepm.register_craft(craftdef)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if have_cg then
|
if have_cg then
|
||||||
local iname = itm
|
|
||||||
if type(iname) == "userdata" then iname = iname:get_name() end
|
|
||||||
|
|
||||||
craftguide.register_craft({
|
craftguide.register_craft({
|
||||||
type = craftdef.type,
|
type = craftdef.type,
|
||||||
output = iname,
|
output = itmst:to_string(),
|
||||||
items = items,
|
items = items,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@ -126,12 +124,9 @@ function elepm.register_craft(craftdef)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if have_cg then
|
if have_cg then
|
||||||
local iname = recipe.output
|
|
||||||
if type(iname) == "userdata" then iname = iname:get_name() end
|
|
||||||
|
|
||||||
craftguide.register_craft({
|
craftguide.register_craft({
|
||||||
type = craftdef.type,
|
type = craftdef.type,
|
||||||
output = iname,
|
output = recipe.output:to_string(),
|
||||||
items = items,
|
items = items,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -44,7 +44,7 @@ local alloy_recipes = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
recipe = { "default:copper_ingot 2", "moreores:silver_ingot" },
|
recipe = { "default:copper_ingot 2", "moreores:silver_ingot" },
|
||||||
output = "basic_materials:brass_ingot",
|
output = "basic_materials:brass_ingot 3",
|
||||||
time = 8,
|
time = 8,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user