File tree Expand file tree Collapse file tree 9 files changed +75
-7
lines changed
common/src/main/java/io/github/thebossmagnus/mods/config_manager/common_coremod
java/io/github/thebossmagnus/mods/config_manager/fabric
neoforge/src/main/resources/META-INF Expand file tree Collapse file tree 9 files changed +75
-7
lines changed Original file line number Diff line number Diff line change 1+ # Modpack Developer Guide
2+
3+ Setup is straightforward:
4+ 1 . Add Config Manager to your modpack (from [ Modrinth] or [ CurseForge] ).
5+ 2 . Copy all configuration files into a folder called ` modpack_default ` inside ` config/ ` .
6+ 3 . The structure inside ` modpack_default ` should mirror the root of the Minecraft directory.
7+
8+ ** Example:**
9+
10+ .minecraft/
11+ ├─ options.txt (the "real" one)
12+ ├─ config/
13+ │ ├─ myMod.json (the modpack one)
14+ │ ├─ modpack_default/
15+ │ │ ├─ options.txt (the modpack one)
16+ │ │ └─ config/
17+ │ │ └─ myMod.json (the "real" one)
18+
19+ ---
20+
21+ ## FAQ
22+
23+ ** Q: Can I forcefully override user preferences for a specific file?**
24+ ** A:** Yes. Place the file directly in its normal location instead of only inside ` modpack_default ` .
25+
26+ ---
27+
28+ ** Q: Can I force an update or reset of user configs?**
29+ ** A:** You can do this by placing a file named ` CONFIG_MANAGER_UPDATE_FLAG ` or ` CONFIG_MANAGER_RESET_FLAG ` in the ` config ` directory.
30+ ** Not recommended.**
31+
32+ ---
33+
34+ ** Q: Can I use this for other content than config files (e.g., .jar files)?**
35+ ** A:** Technically yes, there are no restrictions.
36+ ** Not recommended** as this mod is not designed for that, and it may confuse users.
Original file line number Diff line number Diff line change 1+ # Config Manager
2+
3+ ** Config Manager** is a Minecraft mod that allows modpack developers to ship configuration files in a simple and user-friendly way.
4+ It supports both ** NeoForge** and ** Fabric** , starting from ** Minecraft 1.20.1** and newer.
5+
6+ ---
7+
8+ ## Features
9+
10+ ### Ship modpack defaults without overriding user preferences
11+ - Place your modpack’s default configuration files in ` /config/modpack_default ` .
12+ - At startup, all files from that directory are copied into the Minecraft directory ** only if they do not already exist** .
13+
14+ ** Examples:**
15+ - ` .minecraft/config/modpack_default/options.txt ` → copied to ` .minecraft/options.txt `
16+ - ` .minecraft/config/modpack_default/config/myMod.json ` → copied to ` .minecraft/config/myMod.json `
17+
18+ This ensures that user settings are preserved across modpack updates.
19+
20+ ---
21+
22+ ### Update or reset to the modpack’s defaults
23+ From the mod list (NeoForge) or Mod Menu (Fabric), you can open the Config Manager GUI and choose between two actions:
24+
25+ 1 . ** Update** – Copies (overwriting) the modpack’s config files on top of the user’s.
26+ - All settings changed by the pack are updated.
27+ - Untouched settings remain as configured by the user.
28+
29+ 2 . ** Reset** – Wipes the entire ` config ` directory and replaces it with the files shipped by the modpack.
30+ - Useful to fix broken or corrupted installations.
31+
32+ ---
33+
Original file line number Diff line number Diff line change 99
1010public final class CopyConfig {
1111
12- private static final String dirName = "modpacks_defaults " ;
12+ private static final String dirName = "modpack_defaults " ;
1313
1414 public static void init (Path gameDir ) {
1515
Original file line number Diff line number Diff line change 99import java .util .stream .Stream ;
1010
1111/**
12- * Copies config files from modpacks_defaults , overwriting any existing files in the config directory.
12+ * Copies config files from modpack_defaults , overwriting any existing files in the config directory.
1313 */
1414public final class OverwriteConfig {
1515 private static final String DIR_NAME = "modpack_defaults" ;
Original file line number Diff line number Diff line change 99
1010
1111/**
12- * Deletes all config files except the modpacks_defaults directory, then copies configs from modpacks_defaults .
12+ * Deletes all config files except the modpack_defaults directory, then copies configs from modpack_defaults .
1313 */
1414public final class ResetAndCopyConfig {
1515 private static final String DIR_NAME = "modpack_defaults" ;
1616
1717 /**
18- * Deletes all files and folders in config except modpacks_defaults , then copies files from modpacks_defaults.
18+ * Deletes all files and folders in config except modpack_defaults , then copies files from modpacks_defaults.
1919 */
2020 public static void run (Path gameDir , Logger logger ) {
2121 Path configDir = gameDir .resolve ("config" );
Original file line number Diff line number Diff line change 22
33
44import io .github .thebossmagnus .mods .config_manager .common_coremod .ConfigManagerStartup ;
5- import io .github .thebossmagnus .mods .config_manager .common_coremod .CopyConfig ;
65import net .fabricmc .loader .api .FabricLoader ;
76import net .fabricmc .loader .api .LanguageAdapter ;
87import net .fabricmc .loader .api .LanguageAdapterException ;
Original file line number Diff line number Diff line change 88 " ${mod_author}"
99 ],
1010 "license" : " ${license}" ,
11- "icon" : " ${mod_id} .png" ,
11+ "icon" : " icon .png" ,
1212 "environment" : " *" ,
1313 "entrypoints" : {
1414 "main" : [
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ version = "${version}" #mandatory
77displayName = " ${mod_name}" # mandatory
88# updateJSONURL="https://change.me.example.invalid/updates.json" #optional (see https://docs.neoforged.net/docs/misc/updatechecker/)
99# displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional (displayed in the mod UI)
10- logoFile = " ${mod_id} .png" # optional
10+ logoFile = " icon .png" # optional
1111credits = " ${credits}" # optional
1212authors = " ${mod_author}" # optional
1313description = ''' ${description}''' # mandatory (Supports multiline text)
You can’t perform that action at this time.
0 commit comments