- if stack_width == 0 then
- if #stack_items <= 2 then
- formspec = formspec.."list[context;craft_output_recipe;5,6.3;2,1;]"
- inv:set_size("craft_output_recipe", 2)
- elseif #stack_items > 2 and #stack_items <= 4 then
- formspec = formspec.."list[context;craft_output_recipe;5,5.3;2,2;]"
- inv:set_size("craft_output_recipe", 2*2)
- else
- formspec = formspec.."list[context;craft_output_recipe;5,5.3;3,3;]"
- inv:set_size("craft_output_recipe", 3*3)
- end
- elseif stack_width == 1 then
- if #stack_items == 1 then
- formspec = formspec.."list[context;craft_output_recipe;5,6.3;1,1;]"
- else
- formspec = formspec.."list[context;craft_output_recipe;5,5.3;1,"..#stack_items..";]"
- end
- inv:set_size("craft_output_recipe", 1 * #stack_items)
- elseif stack_width == 2 then
- if #stack_items <= 2 then
- formspec = formspec.."list[context;craft_output_recipe;5,6.3;2,1;]"
- inv:set_size("craft_output_recipe", 2)
- elseif #stack_items > 2 and #stack_items <= 4 then
- formspec = formspec.."list[context;craft_output_recipe;5,5.3;2,2;]"
- inv:set_size("craft_output_recipe", 2*2)
- else
- formspec = formspec.."list[context;craft_output_recipe;5,5.3;2,3;]"
- inv:set_size("craft_output_recipe", 2*3)
- end
- elseif stack_width == 3 then