support all flavors of the update-json format
NikkyAI opened this issue · 1 comments
https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/#update-json-format
to install forge i already use their format
http://files.minecraftforge.net/maven/net/minecraftforge/forge/json
foamfix, charset and other update json files
https://asie.pl/files/minecraft/update/foamfix.json
https://asie.pl/files/minecraft/update/charset.json
https://github.com/williewillus/Botania/blob/master/version/update.json
foamfix and charset require a url template
forge
forge has a vastly different structure
it defines webpath
for the url template +1
promos keys are standard, but they point to the "number" mapping containing
a artifact/build object with the following useful values:
mcversion
forgeversion
branch
a code snippets says more then a thousand words.. well not quite.. but lets try anyway
var longVersion = "${mcversion}-${forgeVersion}"
if (branch != null) {
longVersion += "-$branch"
}
val fileName = "forge-${longVersion]-installer.jar"
val url = "${webpath}/${longVersion}/${fileName}"
foamfix, charset etc..
these do notdefine a webpath
or enough information to put together a url template
worst case the only contains promos
which leads to a version string eg. "0.9.1"
and user input is required
http://asie.pl/files/mods/FoamFix/foamfix-${version}-${mcversion}-anarchy.jar
todo
look at more examples
it seems like there is only 2 formats.. just forge doing their own extension / thing which could be supported by setting the url template to a magic value
but there might be more mods doing their own standards
implemented, forge might be merged in later