mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 17:50:37 +01:00
[creative] Update it to load faster
This commit is contained in:
parent
be67274e25
commit
79bb21808d
@ -39,14 +39,12 @@ minetest.after(0, function()
|
|||||||
for name,def in pairs(minetest.registered_items) do
|
for name,def in pairs(minetest.registered_items) do
|
||||||
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
|
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
|
||||||
and def.description and def.description ~= "" then
|
and def.description and def.description ~= "" then
|
||||||
table.insert(creative_list, name)
|
creative_list[#creative_list+1] = name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
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
|
|
||||||
creative_inventory.creative_inventory_size = #creative_list
|
creative_inventory.creative_inventory_size = #creative_list
|
||||||
--print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
|
--print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user