comply with craftguide api changes

This commit is contained in:
Evert Prants 2018-12-25 18:33:18 +02:00
parent 3e9a13f10c
commit 22bb3a76be
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -34,7 +34,6 @@ function elepm.register_craft_type(name, def)
craftguide.register_craft_type(name, { craftguide.register_craft_type(name, {
description = def.description, description = def.description,
icon = def.icon or "elepower_machine_side.png", icon = def.icon or "elepower_machine_side.png",
width = def.inputs or 2,
}) })
end end
end end
@ -52,7 +51,8 @@ function elepm.register_craft(craftdef)
local inputs = craftdef.recipe local inputs = craftdef.recipe
local outputs = craftdef.output local outputs = craftdef.output
local ctype = craftdef.type local ctype = craftdef.type
local time = (craftdef.time or craftdef.cooktime or 5) + (elepm.craft.types[ctype].time or 0) local ctypedef = elepm.craft.types[ctype]
local time = (craftdef.time or craftdef.cooktime or 5) + (ctypedef.time or 0)
local craftrecipe = {} local craftrecipe = {}
for _,input in ipairs(inputs) do for _,input in ipairs(inputs) do
@ -99,7 +99,7 @@ function elepm.register_craft(craftdef)
type = craftdef.type, type = craftdef.type,
output = itmst, output = itmst,
items = spec, items = spec,
width = 0, width = ctypedef.inputs,
}) })
end end
@ -108,6 +108,7 @@ function elepm.register_craft(craftdef)
type = craftdef.type, type = craftdef.type,
output = itmst:to_string(), output = itmst:to_string(),
items = items, items = items,
width = ctypedef.inputs,
}) })
end end
end end
@ -119,7 +120,7 @@ function elepm.register_craft(craftdef)
type = craftdef.type, type = craftdef.type,
output = recipe.output, output = recipe.output,
items = spec, items = spec,
width = 0, width = ctypedef.inputs,
}) })
end end
@ -128,6 +129,7 @@ function elepm.register_craft(craftdef)
type = craftdef.type, type = craftdef.type,
output = recipe.output:to_string(), output = recipe.output:to_string(),
items = items, items = items,
width = ctypedef.inputs,
}) })
end end
end end