Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
1.0.6' avoid crashing when failing to download mods list (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
nacrt authored Jun 30, 2021
1 parent f416d53 commit 0846fe3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {

ext.kotlin_version = "1.5.0"

version = "1.0.5"
version = "1.0.6"
group = "mynameisjeff"
archivesBaseName = "SkyblockClient-Updater"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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.5"
const val VERSION = "1.0.6"

@JvmField
val mc = Minecraft.getMinecraft()
Expand Down Expand Up @@ -48,4 +48,4 @@ object SkyClientUpdater {
}
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mynameisjeff.skyblockclientupdater.utils

import com.google.gson.JsonParser
import com.google.gson.JsonArray
import mynameisjeff.skyblockclientupdater.SkyClientUpdater
import mynameisjeff.skyblockclientupdater.SkyClientUpdater.mc
import mynameisjeff.skyblockclientupdater.gui.PromptUpdateScreen
Expand Down Expand Up @@ -108,7 +109,15 @@ object UpdateChecker {
}

fun getLatestMods() {
val mods = JsonParser().parse(WebUtils.fetchResponse("https://rawcdn.githack.com/nacrt/SkyblockClient-REPO/$latestCommitID/files/mods.json")).asJsonArray
var mods = JsonArray()
try {
mods = JsonParser().parse(WebUtils.fetchResponse("https://rawcdn.githack.com/nacrt/SkyblockClient-REPO/$latestCommitID/files/mods.json")).asJsonArray
}
catch (ex: Throwable) {
println("Failed to load mod files")
ex.printStackTrace()
}

for (m in mods) {
val mod = m.asJsonObject
val name = mod.get("file").asString
Expand Down

0 comments on commit 0846fe3

Please sign in to comment.