- Basic patches. Only overwritting fields. Change forge and liteloader
- +/-
- In quickmod: mods
- Later: The Rest
This proposal is mostly about changes to the version.json file format, made so that these files can be patched together to form the information needed to create and run an instance. The idea is to only have this description inside the instance directory, thus making it easy to check in the instance to a VCS like Git.
Metadata like name, group, notes etc. will NOT be saved by the json file, and it is up to the implementation to keep them somewhere.
File structure:
<root>/
+- instances/
| +- Vanilla/
| | +- version.json
| | +- patches/
| +- Customized/
| +- version.json
| +- mods.json
| +- custom.json
| +- patches/
| +- net.minecraftforge.json
| +- ftb.lite2.json
+- mods/
| +- minecraftforge/
| | +- forge-1.6.4-9.11.1.965-installer.jar
| | +- ...
| +- mods/
| +- NotEnoughItems-1.6.1.8.jar
| +- ThermalExpansion-3.0.0.2.jar
+- libraries/
+- patches/
| +- optifine-1.6.4.jar
+- net/
+- minecraft/
+- launchwrapper/
| +- 1.8/
| +- launchwrapper-1.8.jar
+- minecraft/
+- 1.6.4/
+- minecraft-1.6.4.jar
+- 1.7.2/
+- minecraft-1.7.2.jar
The customized instance is based of FTB Lite 2, with some mods remove, some added, optifine and a patch applied to forge
All JSON files of an instance are patched together, beginning with version.json, then all files in patches/, in the order given in them (lower number = patched earlier, same number gives warning), and last the custom.json file. Generally the version.json file would describe the instance if it was vanilla. This file should not be edited and might be overwritten by the launcher. The files in patches/ are for forge, liteloader, modpacks etc. They too should generally not be edited by the user and might be overwritten by the launcher. The one file the user should edit is custom.json this is loaded last in the chain, and therefore it can rearrange/overwrite anything.
In the scenario of a modpack, the there would be a modpack file in patches/ that would describe the modpack (mods etc.). The user could then "edit" the modpack by adding/removing mods in the custom.json file.
The general rules: If a field is prefixed with a '+' the value is added to the existing values (a string would be appended, a list would be merged etc.). Prefixing with '-' means removing (it will try to find the value and if found remove it). No prefix means the field will be overwritten.
Can be applied to both libraries and the root element (will be applied to minecraft itself). Can be either a filename (should exist in libraries/patches/) or a object with a QuickMod UID => version mapping (one mod per object).
Describes a set of mods, same internal syntax as patches, but filenames should be in mods/mods/
Used in files in patches/. Specifies in which order patches are "applied". A patch with the order 1 is applied before a patch with the order 5. Same numbers will throw a warning.
Used for libraries and patches. Specifies where in the list they will be put.
For any of the insert types where a name is used '*' can be used as a wildcraft anywhere in the name
Possible values:
Add at the beginning of the list. For patches and custom.json all "beginning" objects will be applied in "reverse", which means they will end up in the same order as in the patch file
Append
Search for an existing entry with the name and apply any new info (+, -, etc) to it. If no such entry exists do nothing.
An object with TYPE => name mappings, where TYPE can be any either "before" or "after".
- Download libraries as usual
- Apply library patches. QuickMod ones may be downloaded, and those that can not be found asked for.
- Download QuickMod mods and ask the user for filename mods it cannot find, like for patches.
- Add mods etc. to the classpath and launch
The custom.json file would be the ONE AND ONLY file that the user may touch. This is also the file which the launcher would change if the user adds/removes mods etc., the content of all the other files should stay, and may be overwritten by the launcher at any time.
The launcher will detect it, give the user a warning and then move it to mods/mods/ and add an entry for it in custom.json
For mods a warning is displayed with the option to ignore it, for libraries and patches an error is shown and the launch will be aborted.
The launcher can and SHOULD overwrite those changes before dealing with the files.
Most JSON files are listed below