From 5ce235d568f80fc5f12bd9899a000e6bbdb288fe Mon Sep 17 00:00:00 2001 From: Tamatea Date: Thu, 22 Feb 2024 09:07:43 +1300 Subject: [PATCH] fix cache loading --- qodat-api/build.gradle.kts | 2 +- .../qodat/cache/impl/oldschool/OldschoolCacheRuneLite.kt | 3 ++- src/main/kotlin/stan/qodat/util/osrs_anim_parser.kt | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qodat-api/build.gradle.kts b/qodat-api/build.gradle.kts index ec82c2c..aa387e9 100644 --- a/qodat-api/build.gradle.kts +++ b/qodat-api/build.gradle.kts @@ -1,7 +1,7 @@ version = "0.0.1" dependencies { - api(group = "net.runelite", name = "cache", version = "1.9.6-SNAPSHOT") { + api(group = "net.runelite", name = "cache", version = "1.10.23-SNAPSHOT") { exclude(group = "com.google.common") } } diff --git a/src/main/kotlin/stan/qodat/cache/impl/oldschool/OldschoolCacheRuneLite.kt b/src/main/kotlin/stan/qodat/cache/impl/oldschool/OldschoolCacheRuneLite.kt index 415ad67..81de1af 100644 --- a/src/main/kotlin/stan/qodat/cache/impl/oldschool/OldschoolCacheRuneLite.kt +++ b/src/main/kotlin/stan/qodat/cache/impl/oldschool/OldschoolCacheRuneLite.kt @@ -7,6 +7,7 @@ import net.runelite.cache.* import net.runelite.cache.definitions.FramemapDefinition import net.runelite.cache.definitions.loaders.FrameLoader import net.runelite.cache.definitions.loaders.FramemapLoader +import net.runelite.cache.definitions.loaders.SequenceLoader import net.runelite.cache.definitions.loaders.SpotAnimLoader import net.runelite.cache.fs.Index import net.runelite.cache.fs.Store @@ -208,7 +209,7 @@ object OldschoolCacheRuneLite : Cache("LIVE") { val seqArchiveFiles = seqArchive.getFiles(seqArchiveData) animations = seqArchiveFiles.files.map { - val sequence = SequenceLoader206().load(it.fileId, it.contents) + val sequence = SequenceLoader().load(it.fileId, it.contents) return@map object : AnimationDefinition { override val id: String = it.fileId.toString() override val frameHashes: IntArray = sequence.frameIDs?: IntArray(0) diff --git a/src/main/kotlin/stan/qodat/util/osrs_anim_parser.kt b/src/main/kotlin/stan/qodat/util/osrs_anim_parser.kt index 7a820ba..dc27ad5 100644 --- a/src/main/kotlin/stan/qodat/util/osrs_anim_parser.kt +++ b/src/main/kotlin/stan/qodat/util/osrs_anim_parser.kt @@ -7,6 +7,7 @@ import net.runelite.cache.ConfigType import net.runelite.cache.IndexType import net.runelite.cache.NpcManager import net.runelite.cache.ObjectManager +import net.runelite.cache.definitions.loaders.SequenceLoader import net.runelite.cache.fs.ArchiveFiles import net.runelite.cache.fs.Store import stan.qodat.Properties @@ -42,7 +43,7 @@ fun createNpcAnimsJsonDir( val frameIndex = store.getIndex(IndexType.ANIMATIONS) val animationFiles = files.files val animations: Map> = animationFiles.parallelStream().map { file -> - val loader = SequenceLoader206() + val loader = SequenceLoader() val anim = loader.load(file.fileId, file.contents) Platform.runLater { val progress = (100.0 * anim.id.toFloat().div(animationFiles.size)) @@ -140,7 +141,7 @@ fun createObjectAnimsJsonDir( val frameIndex = store.getIndex(IndexType.ANIMATIONS) val animationFiles = files.files val animations = animationFiles.parallelStream().map { file -> - val loader = SequenceLoader206() + val loader = SequenceLoader() val anim = loader.load(file.fileId, file.contents) Platform.runLater { val progress = (100.0 * anim.id.toFloat().div(animationFiles.size))