diff options
author | Mattes D <github@xoft.cz> | 2024-03-18 22:02:08 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2024-03-20 12:35:13 +0100 |
commit | ed0b0903835784ffde2b30c43dada3dc62d9e9e9 (patch) | |
tree | b22d7431cb244eaa0f81c92afeef1fb85bdb8663 | |
parent | Plugin InfoReg: Read the info from param (diff) | |
download | cuberite-ed0b0903835784ffde2b30c43dada3dc62d9e9e9.tar cuberite-ed0b0903835784ffde2b30c43dada3dc62d9e9e9.tar.gz cuberite-ed0b0903835784ffde2b30c43dada3dc62d9e9e9.tar.bz2 cuberite-ed0b0903835784ffde2b30c43dada3dc62d9e9e9.tar.lz cuberite-ed0b0903835784ffde2b30c43dada3dc62d9e9e9.tar.xz cuberite-ed0b0903835784ffde2b30c43dada3dc62d9e9e9.tar.zst cuberite-ed0b0903835784ffde2b30c43dada3dc62d9e9e9.zip |
-rw-r--r-- | Server/Plugins/InfoDump.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Server/Plugins/InfoDump.lua b/Server/Plugins/InfoDump.lua index 1cb957947..4daf22383 100644 --- a/Server/Plugins/InfoDump.lua +++ b/Server/Plugins/InfoDump.lua @@ -3,7 +3,7 @@ -- InfoDump.lua --[[ -Loads plugins' Info.lua and dumps its g_PluginInfo into various text formats +Loads plugins' Info.lua and dumps its g_PluginInfo (or gPluginInfo) into various text formats This is used for generating plugin documentation for the forum and for GitHub's INFO.md files This script can be used in two ways: @@ -650,8 +650,8 @@ end ---- Tries to load the g_PluginInfo from the plugin's Info.lua file --- Returns the g_PluginInfo table on success, or nil and error message on failure +--- Tries to load the g_PluginInfo or gPluginInfo from the plugin's Info.lua file +-- Returns the plugin info table on success, or nil and error message on failure local function LoadPluginInfo(a_FolderName) -- Load and compile the Info file: local cfg, err = loadfile(a_FolderName .. "/Info.lua") @@ -668,10 +668,12 @@ local function LoadPluginInfo(a_FolderName) return nil, "Cannot load Info.lua: " .. (errMsg or "<unknown error>") end - if (Sandbox.g_PluginInfo == nil) then - return nil, "Info.lua doesn't contain the g_PluginInfo declaration" + if (Sandbox.g_PluginInfo) then + return Sandbox.g_PluginInfo + elseif (Sandbox.gPluginInfo) then + return Sandbox.gPluginInfo end - return Sandbox.g_PluginInfo + return nil, "Info.lua doesn't contain the g_PluginInfo declaration" end |