More Default Options

Mods
338,622 Downloads Last Updated: Aug 13, 2017 Game Version: 1.12.2

If you are using this mod to customise JourneyMap settings, please see my newer mod JourneyMapDefaults designed specifically for this purpose, making the configuration even simpler.

Overview

This mod is a highly customisable, yet extremely lightweight mod that allows modpack developers to create many custom default in game options. Not only does it support the vanilla options.txt file, but it also supports mods that are configured in game, for example, JourneyMap and FTB Utilities. Note that the mod has zero overhead once the game has loaded and will release all memory used before you start playing, as it is only used during the loading screen.

Purpose

It's generally a bad idea for modpack developers to ship files such as options.txt in their modpacks, as each time the modpack updates, user configured options would be overwritten by the version of the file that ships with the modpack. This is very frustrating for players, when they've spent time setting up their control keys, only to find the settings overwritten when the modpack is updated. However, when a modpack doesn't ship files such as options.txt, the modpack often ends up with many conflicting control key mappings, which can often break mods, or cause confusion for players.

This mod is designed to correct this problem, by copying custom config files to the game directories, but only when the file doesn't already exist. Essentially, the modpack maker's custom option files are only created when the modpack is first launched, and modpack updates will not attempt to overwrite any existing option files that might further customisations by the player.

This mod is not designed for standard mod config files that live in the /config directory, it is for player options, i.e. options set in game by the player. For example, set the default journey map theme, icons or map size, change the default key bindings, options that you otherwise can't set by default.

More Default Options? What's so "More" about it?

There's already a really good mod called Default Options, which does an excellent job of creating a default options.txt, however Mods such as JourneyMap that can be configured in game suffer from the same problem as the options.txt file. It's possible for the modpack to include the config files to customise JourneyMap, but if the user adjusts the JourneyMap configuration, future modpack updates would overwrite these user settings.

This mod was inspired by the Default Options mod, but its main objective was to support the configuration of JourneyMap in modpacks, as I personally find many of the JourneyMap defaults are not optimal for my modpacks.

The mod can also be configured to copy specific default files on either a server, client, or both, allowing modpacks to also create default world generation options on dedicated servers, (i.e. server.properties file).

Configuration

The configuration file for this mod (ironically, not generated by default) is JSON based, an example file is as follows (you can cut and paste this example file to get you started):

[

    {

        "sourceFilePath": "options.txt",

        "destinationFilePath": "options.txt",

        "clientSide": true,

        "serverSide": false

    },

    {

       "sourceFilePath": "journeymap.core.config",

       "destinationFilePath": "journeymap/config/5.2/journeymap.core.config",

       "clientSide": true,

       "serverSide": true

   },

   {

       "sourceFilePath": "journeymap.minimap.config",

       "destinationFilePath": "journeymap/config/5.2/journeymap.minimap.config",

       "clientSide": true,

       "serverSide": false

    }

]

Note that the JSON must be valid and be typo free, or the mod will throw an exception and stop Minecraft loading, this is by design to allow modpack developers to quickly correct the JSON without having to wait for Minecraft to complete loading, however if the configuration file is not present, the mod will log this fact, unload itself and then allow the game to continue loading. There are many online utilities to help you check the JSON is valid, this one is a favourite of mine, obviously, it won't catch typos, but it will certainly catch formatting errors (e.g. missing braces, parenthesis and commas). If you have problems, feel free to post in the comments, and I'll do my best to help (if time allows).

Example

I've got a modpack that uses my mod More Default Options, so if you're looking to see the structure of config files, and test how it works, please see my modpack called PureTech which is available on the Curse launcher.

Directory Structure

An example of a typical directory structure on Windows used by the Curse launcher, might be:

c:\Users\Steve\Documents\Curse\Minecraft\Instances\ModpackName

For the sake of this example, let's call this directory above, GameDir, so typically, your game dir should be structured as follows:

GameDir/

+ Config/

    + MoreDefaultOptions/

        - Options.txt

        - OtherDefaultFile.txt

     - MoreDefaultOptions.json

+ Logs/

+ Mods/

+ ResourcePacks/

-  manifest.json

-  Options.txt

The configuration file MoreDefaultOptions.json, would therefore be found at:

GameDir/Config/MoreDefaultOptions.json

...and the default files should all be located in the directory

GameDir/Config/MoreDefaultOptions/

 Here are some screenshots of a typical working folder configuration

 

FolderStructure1

FolderStructure2

I have a working configuration in a modpack called PureTech that I maintain here on Curse, if you want to download and see the configuration for yourself. This modpack installs a default options.txt, and a default set of configuration for JourneyMap, as shown in the above folder screenshot.

Other Configuration Notes

  • The source default files must be always be stored in MinecraftDir/config/MoreDefaultOptions/. They can't be placed in subdirectories, so the value of sourceFilePath in the JSON configuration file is simply a filename.
  • The destination for the default files are relative to the game directory, so as options.txt would be placed in the top level game directory. You cannot use paths such as "../" to traverse higher in the file system hierarchy. The destinationFilePath must not start with a leading slash.
  • Note, when specifying directory paths, I'd recommend using a unix style forward slash "/", as this has been tested and works on Windows, Mac and Unix, though a back slash "\" should work without any issues too.
  • If you've configured the mod, and it doesn't appear to be working, check the log file (client or server), as it logs actions and errors during start up, which will help you diagnose any problems.
  • This mod could theoretically be used to copy any type of file (images, audio files, even other mods), using the same principle of only creating the file in the desired location so long as the destination file doesn't already exist, though this isn't really a supported feature.
  • The sourceFilePath must be a file, it cannot be a directory.

Miscellaneous 

I'm open to suggestions for improving this mod, and welcome any feedback in the comments, if you find any issues with the mod, please report them using the links on the CurseForge project page.

Comments

  • To post a comment, please or register a new account.
Posts Quoted: