mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 01:16:46 -04:00
load pre flattening registry async
This commit is contained in:
parent
17fb146850
commit
67681afe77
@ -14,6 +14,7 @@
|
||||
package de.bixilon.minosoft.assets.properties.version
|
||||
|
||||
import de.bixilon.kutil.collections.CollectionUtil.synchronizedMapOf
|
||||
import de.bixilon.kutil.concurrent.worker.unconditional.UnconditionalWorker
|
||||
import de.bixilon.kutil.json.MutableJsonObject
|
||||
import de.bixilon.kutil.latch.AbstractLatch
|
||||
import de.bixilon.minosoft.assets.meta.MinosoftMeta
|
||||
@ -30,12 +31,11 @@ object PreFlattening {
|
||||
|
||||
val json: MutableJsonObject = synchronizedMapOf()
|
||||
|
||||
// val worker = UnconditionalWorker()
|
||||
val worker = UnconditionalWorker()
|
||||
for ((type, data) in MinosoftMeta.root) {
|
||||
// worker += { data.load(type, version) }
|
||||
json[type] = data.load(profile, version) ?: continue
|
||||
worker += add@{ json[type] = data.load(profile, version) ?: return@add }
|
||||
}
|
||||
// worker.work(latch)
|
||||
worker.work(latch)
|
||||
|
||||
registries.load(version, json, latch)
|
||||
|
||||
|
@ -22,7 +22,7 @@ import de.bixilon.minosoft.protocol.versions.Version
|
||||
object RegistriesLoader {
|
||||
|
||||
fun load(profile: ResourcesProfile, version: Version, latch: AbstractLatch): Registries {
|
||||
val registries = if (!version.flattened) PreFlattening.loadRegistry(profile, version, latch) else PixLyzerUtil.loadRegistry(version, profile, latch)
|
||||
val registries = if (!version.flattened) PreFlattening.loadRegistry(profile, version, latch) else PixLyzerUtil.loadRegistry(version, profile, latch) // TODO: prioritize pixlyzer and if it fails load meta
|
||||
|
||||
registries.setDefaultParents(version)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user