Skip to content
Stephan Henrichs edited this page Jun 22, 2021 · 36 revisions

PackUpdate is a small tool to update Server-Specific Modpacks inside of MultiMC.

Getting started

Setting up a server requires you to host a small csv file at any URL. Furthermore you should either host the mods yourself or collect a list of URLs.

Please note that PackUpdate will derive the final file name of mods from their metadata and not retain the name from the server. If there is a good reason for this, we might add an option for that in the future.

(Alternative 1) Building the CSV file for your pack manually

Create a zip file for all of your config files. The config files should reside at the root of the zip file.
Optionally create a second file for all non-config resources.

Next, create the CSV file

The CSV file should contain the following fields for each mod, the config.zip and the resources.zip:

  • The name of the Component (should be stable across versions)
  • The version of the Component
  • The download URL. This should be a direct link, however PackUpdate does follow redirect. CurseForge direct download links work as well.
  • the component type. Currently supported are: mod, resources, config and forge. For more information see Component Types
  • (Optional, but highly recommended) A SHA-256 hash sum of the respective file
  • (Optional) a semicolon separated list of flags. For more information see Flags

Additionally you might want to add Forge. Forge needs special handling and therefore is its own component type. You must also specify the component version, for example (Latest Stable as of the time of this writing) 1.12.2-14.23.5.2768. Alternatively you can specify a direct download link. This must be the forge installer jar.

An example might look like this:

Minecraft Forge,1.12.2-14.23.5.2768,,forge
Configs,2019-07-01,https://example.org/packupdate/configs.zip,config,522209239f70411530f75bdf119312b4223b72770cb3da6034b10e9aa2e203ad
Resources,2019-07-01,https://example.org/packupdate/resources.zip,resources,f46d6d42b1eb62ea3a6763bc53299a5be1ad4c514d12bac0dc8fed020f5c262e
AgriCraft,2.12.0-1.12.0-a6,https://example.org/packupdate/mods/AgriCraft-2.12.0-1.12.0-a6.jar,mod,50f12bd84ec29e27f289d09b43012485ccee9e64ebf1c6be56f398c68b066b45,
AppleCore-mc1.12.2,,https://example.org/packupdate/mods/AppleCore-mc1.12.2-3.2.0.jar,mod,be2a1797d44404c6bbddf817385d009a9adb6b9ee84c463f23430ab3e7001c98,
AppleSkin,1.0.9,https://example.org/packupdate/mods/AppleSkin-mc1.12-1.0.9.jar,mod,9bff732c18adf82c4410a827b35d43b68b979f9ede6c2108b6b97550cf386188,
AutoRegLib,1.3-29,https://example.org/packupdate/mods/AutoRegLib-1.3-29.jar,mod,0d6e35a11bfd55c65140ff5378c9e96615781663f1935b8256b03c885c221154,
Bauble Of Undying,1.0.0,https://example.org/packupdate/mods/BaubleOfUndying-1.12-1.0.1.jar,mod,6b9e58e78f5ac54300b49d34253af484ba250f1f89a4e04ccd2c83f653226158,
Baubles,1.12-1.5.2,https://example.org/packupdate/mods/Baubles-1.12-1.5.2.jar,mod,b32010b2f2778aa1188585e7ead91ad46d4cb2c715f9c778a61848ba7fe51f8d,

(Please note that this is only for illustration of the Format. This Pack will actually not launch due to missing dependencies)
Finally the CSV file should be put on some kind of Webserver (Dropbox and similar should work as well).

(Alternative 2) Automate building the CSV file for your pack

Please note that this solution assumes that you host all mods yourself inside a self-contained directory on a webserver.

You will need to install python and downloadpackupdate-gen.py. In the following i will assume you placed this script in your path (On *nix systems a good place would be /usr/local/bin/packupdate-gen).

Next you need to pick a URL to host your pack at. For purposes of this Guide we will use https://example.org/packupdate. Inside of that directory we will host all downloadable files of that pack as well as the metadata. Finally we need to have a working mod pack with all mods, configs and other files. In this example we assume this is located directly within the web root at /srv/http/example.org/packupdate. We will locate the pack CSV at /srv/http/example.org/packupdate/example.pack. This file however can be somewhere completely different. The path of this file does not matter, it needs to be web accessible too though.

Once we have reached that state we switch working directory to /srv/http/example.org/packupdate.

If you want to include resources (like a servers.dat or crafttweaker scripts) you should create a file resources.packupdate. Inside that file you should list the relative paths of all involved files (wildcards are currently not supported), separated by newlines. An example might look like this:

servers.dat
scripts/candles.zs
scripts/mortars.zs
scripts/rustic.zs

If you want to set flags for one or more mods you should also add a flags.packupdate. This file is a csv with the fields mod_name and flags. Flags are semicolon-separated like in the pack csv. An example might look like this:

OptiFine_1.12.2_HD_U_E3.jar,optional;client_only
Better Portals,disabled
GeographiCraft,server_only

Please note that OptiFine has its file name as mod name. This is because optifine does not have an mcmod.info in its jar. In that case packupdate-gen attempts to guess the name from its file name. This is done by splitting the file name at each dash, then taking all components until the first component that starts with a digit. PackUpdate will then assume that next component to be the version. Since OptiFine does not contain any dashes it will use the entire file name.

Finally you can also include forge in the pack by creating a file called forge.packupdate and putting a full forge version inside of it (like 1.12.2-14.23.5.2854)

Once that is done you can run packupdate-gen. It expects two parameters. The first is the URL at which the pack will be hosted (in particular the contents of the working directory will have to reside at that url). The second parameter is the relative path to the generated pack csv. In our example the call would be packupdate-gen https://example.org/packupdate example.pack. The pack is now complete. To update the pack CSV after changing things about the pack just re-run this last step.

This method has been tested with a git annex/lfs repo to host the pack contents (incl *.packupdate files). A cronjob then updates the local on the server repo and regenerates the pack.csv. This leads to a setup where rolling out an update to the pack is a simple git push

(Alternative 1) Creating the Minecraft instance manually

Create a new instance in MultiMC and drop the UpdaterUpdater.jar in its directory. Adjust settings as you want (and install forge!). Then set the Pre-Launch hook to "$INST_DIR/UpdaterUpdater.jar" client <url of your csv>. Now you should launch your game and test if it works. If you want you can opt into beta releases by changing the beta value in $INST_MC_DIR/packupdate/updater.properties to true. Alternatively you can use the PackUpdate jar in place of the UpdaterUpdater.jar, however this makes updating PackUpdate itself much harder.

Exporting the MultiMC instance

Use MultiMCs feature to export the instance. Make sure to include the following:

  • instance.cfg
  • mmc-pack.json
  • UpdaterUpdater.jar
  • packupdate/updater.properties if you have changed anything
  • icon.png if you have set a custom icon

You can include more, but if everything is done correctly this is usually not necessary, as PackUpdate will download everything else

Do NOT include packupdate/local.json, or things will break horribly

(Alternative 2) Generating the Minecraft instance

In order to do this you currently need to specify the Forge version in the pack CSV
Run packupdate like this:

java -jar PackUpdate.jar generate --pack-url https://example.org/packupdate --out Pack.zip

Additional Options you can specify:

  • --beta - Also use beta versions of PackUpdate
  • --update-url - API endpoint to use for the selfupdate. This was used prior to 2.x to allow testing beta versions with the autoupdater.
  • --icon-key - the name of the icon the instance should have. Custom icons are currently not supported
  • --java-xms and --java-xmx - the memory options in megabyte for the instance

Setting up the server

Firstly create a new empty directory for the server to reside in. Change to that directory and run packupdate with the server subcommand and the pack URL as parameter. PackUpdate will now install all mods into the current directory. If the pack contains a forge component, it will also install Minecraft Forge and the minecraft_server.*.jar. Re-Run this command to update the server. If you have a launch script, it can be a good idea to add that command to run before the server launches.

Example:

java -jar UpdaterUpdater.jar server https://example.org/packupdate/example.pack