From f8bb3bd2ca29d932cb6a0276f2979555613613a6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 2 Jun 2017 22:09:07 +0200 Subject: [PATCH] Creative inv.: Use set_list for performance boost --- mods/HUD/mcl_inventory/creative.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 6ccf9eea93..81516f3658 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -81,9 +81,7 @@ local function set_inv_search(filter, player) table.sort(creative_list) inv:set_size("main", #creative_list) - for _,itemstring in ipairs(creative_list) do - inv:add_item("main", ItemStack(itemstring)) - end + inv:set_list("main", creative_list) mcl_inventory.creative_inventory_size = #creative_list end @@ -96,9 +94,7 @@ local function set_inv_page(page, player) creative_list = inventory_lists[page] end inv:set_size("main", #creative_list) - for _,itemstring in ipairs(creative_list) do - inv:add_item("main", ItemStack(itemstring)) - end + inv:set_list("main", creative_list) mcl_inventory.creative_inventory_size = #creative_list end