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
1 changed files with 9 additions and 7 deletions

View File

@ -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