Skip to content

Commit

Permalink
Make mods initialize in the correct order, but effectively disabling …
Browse files Browse the repository at this point in the history
…multithreading on mod init
  • Loading branch information
BluSpring committed Jan 12, 2025
1 parent 21b0ca5 commit 0c81791
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/xyz/bluspring/kilt/loader/KiltLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -619,14 +619,15 @@ class KiltLoader {

runBlocking {
launch(Dispatchers.Default) {
modLoadingQueue.asFlow().concurrent().onEach { mod ->
// TODO: Need to make sure to group mods together so they load in the correct order from each other
modLoadingQueue.forEach { mod ->
try {
if (!mod.shouldScan) {
mod.scanData = ModFileScanData()
mods.add(mod)
exceptions.addAll(registerAnnotations(mod, mod.scanData))

return@onEach
return@forEach
}

val scanData = ModFileScanData()
Expand Down Expand Up @@ -658,7 +659,7 @@ class KiltLoader {
e.printStackTrace()
exceptions.add(e)
}
}.launchIn(this).join()
}
}.join()
}

Expand Down

0 comments on commit 0c81791

Please sign in to comment.