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)