From 3c83904eb03fb6652de14ad69d629e5c9128b4b6 Mon Sep 17 00:00:00 2001 From: jp Date: Wed, 2 Dec 2015 23:30:21 +0100 Subject: [PATCH] Craft guide : check for stack of width 0 --- worktable.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/worktable.lua b/worktable.lua index 1667038..4911bf5 100644 --- a/worktable.lua +++ b/worktable.lua @@ -68,8 +68,16 @@ function worktable.craft_output_recipe(pos, start_i, pagenum, stackname) if stack_count and inv:is_empty("item_craft_input") then inv:add_item("item_craft_input", stackname.." "..stack_count-1) end - - if stack_width == 0 or stack_width == 1 then + + if stack_width == 0 then + if #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