Migrate to modern plugins: fix errors in util/mt-ide-helper & add changes that fixes most errors in code. LG-1978

This commit is contained in:
alek13
2025-09-16 19:05:54 +03:00
parent f8c9f7d83b
commit 0ca47db2ea
26 changed files with 301 additions and 160 deletions

View File

@@ -2,31 +2,31 @@
local DetachedInventoryCallbacksDef = {
--- Called when a player wants to move items inside the inventory.
--- Return value: number of items allowed to move.
--- @type fun(inv:InvRef, from_list:string, from_index:number, to_list:string, to_index:number, count:number, player:Player):number
--- @type nil|fun(inv:InvRef, from_list:string, from_index:number, to_list:string, to_index:number, count:number, player:Player):number
allow_move = nil,
--- Called when a player wants to put something into the inventory.
--- Return value: number of items allowed to put.
--- Return value -1: Allow and don't modify item count in inventory.
--- @type fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player):number
--- @type nil|fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player):number
allow_put = nil,
--- Called when a player wants to take something out of the inventory.
--- Return value: number of items allowed to take.
--- Return value -1: Allow and don't modify item count in inventory.
--- @type fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player):number
--- @type nil|fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player):number
allow_take = nil,
--- Called after the actual action has happened, according to what was allowed (see `allow_move()`).
--- No return value.
--- @type fun(inv:InvRef, from_list:string, from_index:number, to_list:string, to_index:number, count:number, player:Player):void
--- @type nil|fun(inv:InvRef, from_list:string, from_index:number, to_list:string, to_index:number, count:number, player:Player):void
on_move = nil,
--- Called after the actual action has happened, according to what was allowed (see `allow_put()`).
--- No return value.
--- @type fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player)
--- @type nil|fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player)
on_put = nil,
--- Called after the actual action has happened, according to what was allowed (see `allow_take()`).
--- No return value.
--- @type fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player)
--- @type nil|fun(inv:InvRef, list_name:string, index:number, stack:ItemStack, player:Player)
on_take = nil,
}