Add 2.0 support to module template

This commit is contained in:
Cooldude2606 committed 2024-11-23 14:26:12 +00:00
1 parent 2ba33d58ed
commit 8b551deda8
3 files changed
+42 -18

No files matched your search

+5 -1
View File
@@ -1,11 +1,15 @@
local api = require('modules/clusterio/api')
local compat = require("modules/clusterio/compat")
--- @class (exact) EventData.on_server_startup:EventData
local function check_patch()
local script_data = compat.script_data()
if script_data.clusterio_patch_number ~= clusterio_patch_number then
script_data.clusterio_patch_number = clusterio_patch_number
script.raise_event(api.events.on_server_startup, {})
script.raise_event(api.events.on_server_startup, {
name = api.events.on_server_startup, tick = game.tick
})
end
end