4
0
Fork 0
mirror of https://github.com/Anvilcraft/modpacktools synced 2024-05-19 20:04:07 +02:00

fix ListRelations alphabetical sorting

This commit is contained in:
LordMZTE 2020-08-14 19:05:01 +02:00
parent c7b6672601
commit 38d9f13547
2 changed files with 7 additions and 5 deletions

View file

@ -39,10 +39,10 @@ object DownloadMods : AbstractCommand("DownloadMods") {
val json = MPJH.asWrapper
val fileList = mutableListOf<FileOrLink>()
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())

View file

@ -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 {