Skip to content

Commit

Permalink
fix: modrinth modpack parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
darksaid98 committed May 21, 2024
1 parent a398bbc commit 1cf9b52
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ open class ModrinthPackType(private val configFile: ConfigFile, internetManager:
val mcObj = json.getAsJsonObject("dependencies")

if (mcVersion.isEmpty()) {
mcVersion = mcObj.getAsJsonArray("minecraft").asString
mcVersion = mcObj.getAsJsonPrimitive("minecraft").asString
}

// gets the modrinth version
Expand All @@ -134,7 +134,7 @@ open class ModrinthPackType(private val configFile: ConfigFile, internetManager:
for (jsonElement in json.getAsJsonArray("files")) {
val obj = jsonElement.asJsonObject
// don't download things unsupported on the server
if (obj.getAsJsonObject("env").getAsJsonPrimitive("server").asString.equals("unsupported")) {
if (obj.getAsJsonObject("env")?.getAsJsonPrimitive("server")?.asString.equals("unsupported")) {
continue
} else {
val downloadUrl = obj.getAsJsonArray("downloads").get(0).asString
Expand Down

0 comments on commit 1cf9b52

Please sign in to comment.