diff --git a/src/main/kotlin/ley/anvil/modpacktools/commands/DownloadMods.kt b/src/main/kotlin/ley/anvil/modpacktools/commands/DownloadMods.kt index 217dc8f..d860f43 100644 --- a/src/main/kotlin/ley/anvil/modpacktools/commands/DownloadMods.kt +++ b/src/main/kotlin/ley/anvil/modpacktools/commands/DownloadMods.kt @@ -39,10 +39,10 @@ object DownloadMods : AbstractCommand("DownloadMods") { val json = MPJH.asWrapper val fileList = mutableListOf() for( - rel in json!!.defaultVersion!!.getRelations( - arrayOf("client"), - if(args.getBoolean("all")) null else arrayOf("mod") - )!! + rel in json!!.defaultVersion!!.getRelations( + arrayOf("client"), + if(args.getBoolean("all")) null else arrayOf("mod") + )!! ) //TODO only client? what if someone wants a server? if(rel.hasFile()) fileList.add(rel.file.get()) diff --git a/src/main/kotlin/ley/anvil/modpacktools/commands/ListRelations.kt b/src/main/kotlin/ley/anvil/modpacktools/commands/ListRelations.kt index 5c6aa12..49dff76 100644 --- a/src/main/kotlin/ley/anvil/modpacktools/commands/ListRelations.kt +++ b/src/main/kotlin/ley/anvil/modpacktools/commands/ListRelations.kt @@ -29,7 +29,9 @@ object ListRelations : AbstractCommand("ListRelations") { } override fun execute(args: Namespace): CommandReturn { - val metas = MPJH.getModMetas().sortedBy {it.name} + val metas = MPJH.getModMetas().sortedWith( + Comparator {a, b -> b.name?.let {a.name?.compareTo(it, true)} ?: 0} + ) if(args.getBoolean("csv")) { metas.forEach {