mcl_cozy: Restore backwards compatibility

Some mods might expect `mcl_cozy.pos` to be an existing table, the
functionality of which was changed to be included in `mcl_cozy.players`.
This commit is contained in:
Mikita Wiśniewski 2025-03-06 21:04:22 +07:00 committed by the-real-herowl
parent d463bba91f
commit 0f65037482

View file

@ -16,6 +16,13 @@ local ACTION_APPLY_DELAY = 0.05
mcl_cozy = {}
mcl_cozy.players = {}
-- backwards compatibility
mcl_cozy.pos = setmetatable({}, {
__index = function(_, name)
return mcl_cozy.players[name] and mcl_cozy.players[name][1]
end
})
-- TODO: when the API is more polished and there is demand, un-internalize this
local actions = {
["sit"] = {