Use the IO coroutines dispatcher in Configuration.kt
This commit is contained in:
parent
7eb4cdf69a
commit
546a4d118e
|
@ -12,6 +12,7 @@ import fr.username404.snowygui.gui.feature.Category
|
|||
import fr.username404.snowygui.gui.feature.Macro
|
||||
import io.github.config4k.extract
|
||||
import io.github.config4k.getValue
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
@ -52,7 +53,7 @@ object Configuration {
|
|||
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 suspend fun writeConfig(c: Config) = coroutineScope {
|
||||
launch {
|
||||
launch(Dispatchers.IO) {
|
||||
file.writeText(
|
||||
"""
|
||||
|Snowy {
|
||||
|
|
Loading…
Reference in New Issue