Posted February 20, 20196 yr 1.13.2 By upgradingFMLPreInitializationEvent. GetSuggestedConfigurationFile () I can not use it. Is there any other way to get the path of the config file?
February 20, 20196 yr Author This is because MOD designed for 1.12 uses the path to the config file and if we can acquire the path, we thought that we could minimize the work to support 1.13.
June 18, 20196 yr Like @tokuhausu, I am also trying to port an older mod. @diesieben07 would it be possible to provide any pointers to where the overhauled configuration system is described or implemented? The update notes for mod creators do not mention this. Thank you.
June 19, 20196 yr It changed from .cfg to .toml and now uses a proper library (electronwill’s nightconfig library with a wrapper for comments and syncing). It was also cleaned up a lot. Configuration doesn’t exist anymore and @Config hasn’t been ported yet. Here’s the commit in which I add an example config to my example mod https://github.com/Cadiboo/Example-Mod/commit/43db50e176d758ade2338764d7e2fe1b63aae7dd About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 20, 20196 yr On 6/19/2019 at 3:06 AM, Cadiboo said: It changed from .cfg to .toml and now uses a proper library (electronwill’s nightconfig library with a wrapper for comments and syncing). It was also cleaned up a lot. Configuration doesn’t exist anymore and @Config hasn’t been ported yet. Here’s the commit in which I add an example config to my example mod https://github.com/Cadiboo/Example-Mod/commit/43db50e176d758ade2338764d7e2fe1b63aae7dd Hi, Thanks for posting your example mod! its a real help since forge decided to change everything, however, looking through your code I couldn't figure out how it actaully is you access the values stored in the config? Like how do i determine whether "clientBoolean" is true or false? Thanks! UPDATE: Sorry, I figured out how to get it. However, When i change the file with MC open, the value does not change when im retrieving it. Is this intentional, or am I meant to be doing something else? I did notice that the setValueAndSave() function is never used. Thanks again! Edited June 20, 20196 yr by Vistaf Update
June 22, 20196 yr The values in the ExampleModConfig class are the “baked” values from the config. They are the runtime representations of the config values (because looking them up each time you use them is expensive) and shouldn’t be changed from outside the “bakeConfig” method. Making them only accessible through getters would be good encapsulation. However, config saving is asynchronous (it happens on another thread) so if you want the correct value that you just set immediately, you’ll need to update it in code yourself. Edit: I’ll try n find an example Edited June 22, 20196 yr by Cadiboo About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.