mirror of
https://github.com/minetest-mods/i3.git
synced 2025-07-06 18:40:22 +02:00
Add 'ignore hotbar' option for inventory sorting
This commit is contained in:
9
API.md
9
API.md
@ -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,
|
||||
}
|
||||
|
Reference in New Issue
Block a user