Fix incorrect recipe registration for craftguide and i3

This commit is contained in:
SmallJoker 2024-12-16 20:42:57 +01:00
parent 59643c45d4
commit 3bece9cec5

@ -32,7 +32,10 @@ function technic.register_recipe_type(typename, origdata)
end end
local function get_recipe_index(items) local function get_recipe_index(items)
if not items or type(items) ~= "table" then return false end if type(items) ~= "table" then
return false
end
local l = {} local l = {}
for i, stack in ipairs(items) do for i, stack in ipairs(items) do
l[i] = ItemStack(stack):get_name() l[i] = ItemStack(stack):get_name()
@ -75,22 +78,21 @@ local function register_recipe(typename, data)
end end
if (have_cg or have_i3) and technic.recipes[typename].output_size == 1 then if (have_cg or have_i3) and technic.recipes[typename].output_size == 1 then
local result = data.output local result = data.output
if (type(result)=="table") then if type(result) == "table" then
result = result[1] result = result[1]
end end
local items = table.concat(data.input, ", ")
if have_cg and craftguide.register_craft then if have_cg and craftguide.register_craft then
craftguide.register_craft({ craftguide.register_craft({
type = typename, type = typename,
result = result, result = result,
items = {items}, items = data.input,
}) })
end end
if have_i3 then if have_i3 then
i3.register_craft({ i3.register_craft({
type = typename, type = typename,
result = result, result = result,
items = {items}, items = data.input,
}) })
end end
end end