Add 'ignore hotbar' option for inventory sorting

This commit is contained in:
Jean-Patrick Guerrero
2021-11-01 15:12:32 +01:00
parent 9276598e3e
commit 1728f4beac
6 changed files with 49 additions and 55 deletions

9
API.md
View File

@ -251,12 +251,13 @@ Example:
i3.add_sorting_method {
name = "test",
description = "Cool sorting method",
func = function(player, data)
local inv = player:get_inventory()
local list = inv:get_list("main")
func = function(list, data)
-- `list`: inventory list
-- `data`: player data
table.sort(list)
-- An array of items must be returned
-- A list must be returned
return list
end,
}