diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt index 3aaf4a4..6511c9d 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt @@ -25,8 +25,9 @@ object Configuration { private fun Config.withFullModifiableValues() = ModifiableValues.entries.fold(this) { previous, entry -> previous.withValue(entry.key, entry.value.get()) } - private val file: File = File(Minecraft.getInstance().gameDirectory.absolutePath + File.separator + "snowy.conf") - private val macroFile: File = File(Minecraft.getInstance().gameDirectory.absolutePath + File.separator + "snowy-macros.json") + private val configDirectory: String = (Minecraft.getInstance().gameDirectory.absolutePath + File.separator + "config").also { File(it).mkdir() } + private val file: File = File(configDirectory + File.separator + "snowy.conf") + private val macroFile: File = File(configDirectory + File.separator + "snowy-macros.json") private suspend fun writeConfig(c: Config) = coroutineScope { launch { file.writeText(