From 5469940c3ce2c9573164c0f15c5bc54f83ffdf86 Mon Sep 17 00:00:00 2001 From: JP Guerrero Date: Wed, 14 Dec 2016 18:29:08 +0100 Subject: [PATCH] Set crafting grid limit to 5 for big recipes --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 28c3afe..9a112cc 100644 --- a/init.lua +++ b/init.lua @@ -92,9 +92,10 @@ function craftguide:get_recipe(player_name, tooltip_l, item, recipe_num, recipes -- Lua 5.3 removed `table.maxn`, use this alternative in case of breakage: -- https://github.com/kilbith/xdecor/blob/master/handlers/helpers.lua#L1 local rows = ceil(table.maxn(items) / width) - local btn_size = 1 + local btn_size, craftgrid_limit = 1, 5 - if recipe_type == "normal" and width > 6 or rows > 6 then + if recipe_type == "normal" and + width > craftgrid_limit or rows > craftgrid_limit then formspec = formspec.."label["..(offset_X)..","..(iY+2).. ";Recipe is too big to\nbe displayed (".. width.."x"..rows..")]"