mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Add 2.0 support to core lua
This commit is contained in:
6 files changed
+46
-54
No files matched your search
@@ -1,11 +1,12 @@
|
||||
local function send_json(channel, data)
|
||||
data = game.table_to_json(data)
|
||||
data = helpers and helpers.table_to_json(data) or game.table_to_json(data)
|
||||
print("\f$ipc:" .. channel .. "?j" .. data)
|
||||
end
|
||||
|
||||
script.on_init(function()
|
||||
send_json("mod_list", game.active_mods)
|
||||
for name, mod_setting in pairs(game.mod_setting_prototypes) do
|
||||
send_json("mod_list", script.active_mods)
|
||||
local mod_settings = prototypes and prototypes.mod_setting or game.mod_setting_prototypes
|
||||
for name, mod_setting in pairs(mod_settings) do
|
||||
send_json("mod_setting_mod", { name = name, mod = mod_setting.mod })
|
||||
end
|
||||
end)
|
||||
Reference in new issue
Block a user