From 18e16403fd86aee6cf4fe50d68f9117af0f14a82 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sun, 15 Aug 2021 13:34:34 -0400 Subject: [PATCH] 1.0.8 --- build.gradle | 2 +- .../mynameisjeff/skyblockclientupdater/SkyClientUpdater.kt | 6 +++--- .../skyblockclientupdater/utils/UpdateChecker.kt | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index b4e45e9..3d1033f 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { ext.kotlin_version = "1.5.21" -version = "1.0.7" +version = "1.0.8" group = "mynameisjeff" archivesBaseName = "SkyblockClient-Updater" diff --git a/src/main/kotlin/mynameisjeff/skyblockclientupdater/SkyClientUpdater.kt b/src/main/kotlin/mynameisjeff/skyblockclientupdater/SkyClientUpdater.kt index 1cd6b31..689a1fb 100644 --- a/src/main/kotlin/mynameisjeff/skyblockclientupdater/SkyClientUpdater.kt +++ b/src/main/kotlin/mynameisjeff/skyblockclientupdater/SkyClientUpdater.kt @@ -13,10 +13,10 @@ import net.minecraftforge.fml.common.gameevent.TickEvent @Mod(modid = "skyblockclientupdater", name = "SkyClient Updater", version = SkyClientUpdater.VERSION, clientSideOnly = true, modLanguage = "kotlin", modLanguageAdapter = "mynameisjeff.skyblockclientupdater.utils.kotlin.KotlinAdapter") object SkyClientUpdater { - const val VERSION = "1.0.7" + const val VERSION = "1.0.8" - @JvmField - val mc = Minecraft.getMinecraft() + val mc: Minecraft + get() = Minecraft.getMinecraft() var displayScreen: GuiScreen? = null diff --git a/src/main/kotlin/mynameisjeff/skyblockclientupdater/utils/UpdateChecker.kt b/src/main/kotlin/mynameisjeff/skyblockclientupdater/utils/UpdateChecker.kt index d34ac78..ae00ba1 100644 --- a/src/main/kotlin/mynameisjeff/skyblockclientupdater/utils/UpdateChecker.kt +++ b/src/main/kotlin/mynameisjeff/skyblockclientupdater/utils/UpdateChecker.kt @@ -143,7 +143,7 @@ object UpdateChecker { loopMods@ for (modFile in needsChecking) { val fileName = modFile.name for (modEntry in allowedRemoteChecks) { - if (!checkMatch(modEntry, fileName)) + if (!checkMatch(modEntry, fileName)) continue needsUpdate.add(Triple(modFile, modEntry, latestMods[modEntry]!!)) continue@loopMods } @@ -159,8 +159,8 @@ object UpdateChecker { val distance = StringUtils.getLevenshteinDistance(expected, received) if (distance !in 1..6) return false - val ec = e.filterIndexed { index, c -> c != r[index] } - val rc = r.filterIndexed { index, c -> c != e[index] } + val ec = e.filterIndexed { index, c -> c != r.getOrNull(index) } + val rc = r.filterIndexed { index, c -> c != e.getOrNull(index) } if (listOf(ec, rc).flatten().none { !it.isDigit() && !whitespace.contains(it) }) { return (ec.firstOrNull { it.isDigit() }?.digitToInt() ?: 0) > (rc.firstOrNull { it.isDigit() }?.digitToInt() ?: 0)