From 22bb3a76bef8b803ce25b79612bac531b7068a9b Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Tue, 25 Dec 2018 18:33:18 +0200 Subject: [PATCH] comply with craftguide api changes --- elepower_machines/craft.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/elepower_machines/craft.lua b/elepower_machines/craft.lua index 862a8f5..f617b83 100644 --- a/elepower_machines/craft.lua +++ b/elepower_machines/craft.lua @@ -34,7 +34,6 @@ function elepm.register_craft_type(name, def) craftguide.register_craft_type(name, { description = def.description, icon = def.icon or "elepower_machine_side.png", - width = def.inputs or 2, }) end end @@ -49,10 +48,11 @@ function elepm.register_craft(craftdef) return end - local inputs = craftdef.recipe - local outputs = craftdef.output - local ctype = craftdef.type - local time = (craftdef.time or craftdef.cooktime or 5) + (elepm.craft.types[ctype].time or 0) + local inputs = craftdef.recipe + local outputs = craftdef.output + local ctype = craftdef.type + local ctypedef = elepm.craft.types[ctype] + local time = (craftdef.time or craftdef.cooktime or 5) + (ctypedef.time or 0) local craftrecipe = {} for _,input in ipairs(inputs) do @@ -99,7 +99,7 @@ function elepm.register_craft(craftdef) type = craftdef.type, output = itmst, items = spec, - width = 0, + width = ctypedef.inputs, }) end @@ -108,6 +108,7 @@ function elepm.register_craft(craftdef) type = craftdef.type, output = itmst:to_string(), items = items, + width = ctypedef.inputs, }) end end @@ -119,7 +120,7 @@ function elepm.register_craft(craftdef) type = craftdef.type, output = recipe.output, items = spec, - width = 0, + width = ctypedef.inputs, }) end @@ -128,6 +129,7 @@ function elepm.register_craft(craftdef) type = craftdef.type, output = recipe.output:to_string(), items = items, + width = ctypedef.inputs, }) end end