Merge Game, FlyingText, Common and table

This commit is contained in:
Cooldude2606
2024-09-30 22:32:35 +01:00
parent 3145f7e904
commit f8c74c9dd3
66 changed files with 817 additions and 2035 deletions

View File

@@ -1,15 +1,19 @@
--- Will move players items to spawn when they are banned or kicked, option to clear on leave
-- @addon Inventory-Clear
local ExpUtil = require("modules/exp_util")
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
local events = require("modules.exp_legacy.config.inventory_clear") --- @dep config.inventory_clear
local move_items_stack = _C.move_items_stack --- @dep expcore.common
local function clear_items(event)
local player = game.players[event.player_index]
local inv = player.get_main_inventory() --- @cast inv -nil
move_items_stack(inv)
inv.clear()
local inventory = assert(player.get_main_inventory())
ExpUtil.transfer_inventory_to_surface{
inventory = inventory,
surface = game.surfaces[1],
name = "iron-chest",
allow_creation = true,
}
end
for _, event_name in ipairs(events) do Event.add(event_name, clear_items) end