Modpack Config Updater: A Modpack Tool for Minecraft
Modpack Config Updater is a powerful modpack tool designed to make updating modpacks easier and more efficient. When a modpack creator publishes an update, they often need to edit a specific configuration for the end-user. Without Modpack Config Updater, the creator is forced to upload an entire file, overriding all configurations contained within it for the end-user. If the user has customized configurations in that file, they are lost. Modpack Config Updater solves this problem by allowing the editing of individual configurations without having to override the entire file.
How Modpack Config Updater Works
The mod stores the current version of the modpack in a file named "modpack_version.txt". After a modpack update, upon the first launch of the game, the mod takes action. It applies the configuration changes to the player's configuration, and the "modpack_version.txt" is filled with the new version name.
Storing and Applying Configuration Changes
Modpack Config Updater has a configuration file located at config/modpackconfigupdater/modpackconfigupdater.json
:
{
"overrides": [
"example_version1",
"example_version2",
"example_version3",
"example_version4"
]
}
Each override defined is a version name and points to a folder with the same name in config/modpackconfigupdater/overrides
. Each of these folders contains the changes for the corresponding version. For example, if you have the file config/mod_config.properties
containing:
properties1=value1
properties2=value2
properties3=value3
And you want to modify the value of properties2
and add properties4
in version example_version1
, you would create config/modpackconfigupdater/overrides/example_version1/config/mod_config.properties:
properties2=value42
properties4=value4
Upon the first launch, config/mod_config.properties
will be updated to contain:
properties1=value1
properties2=value42
properties3=value3
properties4=value4
And modpack_version.txt
will now contain example_version1
. When you'll close and then launch the game again, example_version1
will not be applied again. But if in the meantime you add other versions in modpackconfigupdater.json, this version will be applied.
Handling Multiple Version Jumps
If a user skips several versions, for example, going from version example_version1
to example_version4
, the changes from versions example_version2
and example_version3
will be applied before applying the changes from example_version4
.
Technical Specifications
Supported File Extensions
Modpack Config Updater only takes into account files with the following extensions:
"json", "properties", "yml", "yaml", "txt", "conf", "cfg", "ini", "xml", "properties", "ini", "rc", "config", "settings", "pref", "env", "toml"
Data Formats
The mod can handle various data formats, including JSON, YAML, and Properties. While TOML and XML formats are not yet implemented, they are quite rare in mod configuration files. JSON5 will be added soon.
The way a file is interpreted depends on the shape of its content, not its extension. Therefore, any file among those with supported extensions is inspected and processed according to the detected data format. If the file is not valid, the format is not processed. (In the alpha phase of the mod, it is possible to lose data or break files if the merge file is not well-formatted. Please exercise caution.)
First Launch and Example Configuration
Upon the very first launch with the mod, when there is no modpack_version.txt
or config/modpackconfigupdater
present, an example configuration will be generated and applied. You can build your first updates based on this example.