mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Creative inv.: Use set_list for performance boost
This commit is contained in:
parent
ed5f487f63
commit
f8bb3bd2ca
1 changed files with 2 additions and 6 deletions
|
@ -81,9 +81,7 @@ local function set_inv_search(filter, player)
|
||||||
table.sort(creative_list)
|
table.sort(creative_list)
|
||||||
|
|
||||||
inv:set_size("main", #creative_list)
|
inv:set_size("main", #creative_list)
|
||||||
for _,itemstring in ipairs(creative_list) do
|
inv:set_list("main", creative_list)
|
||||||
inv:add_item("main", ItemStack(itemstring))
|
|
||||||
end
|
|
||||||
mcl_inventory.creative_inventory_size = #creative_list
|
mcl_inventory.creative_inventory_size = #creative_list
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -96,9 +94,7 @@ local function set_inv_page(page, player)
|
||||||
creative_list = inventory_lists[page]
|
creative_list = inventory_lists[page]
|
||||||
end
|
end
|
||||||
inv:set_size("main", #creative_list)
|
inv:set_size("main", #creative_list)
|
||||||
for _,itemstring in ipairs(creative_list) do
|
inv:set_list("main", creative_list)
|
||||||
inv:add_item("main", ItemStack(itemstring))
|
|
||||||
end
|
|
||||||
mcl_inventory.creative_inventory_size = #creative_list
|
mcl_inventory.creative_inventory_size = #creative_list
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue