diff --git a/src/main/java/com/terraformersmc/modmenu/util/mod/Mod.java b/src/main/java/com/terraformersmc/modmenu/util/mod/Mod.java index 268b3a08..877df022 100644 --- a/src/main/java/com/terraformersmc/modmenu/util/mod/Mod.java +++ b/src/main/java/com/terraformersmc/modmenu/util/mod/Mod.java @@ -78,7 +78,7 @@ default String getTranslatedDescription() { * @return a mapping of roles to each contributor with that role. */ @NotNull - SortedMap> getCredits(); + SortedMap> getCredits(); @NotNull Set getBadges(); diff --git a/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricDummyParentMod.java b/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricDummyParentMod.java index 39e3ac26..e3c1e7d3 100644 --- a/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricDummyParentMod.java +++ b/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricDummyParentMod.java @@ -94,7 +94,7 @@ public FabricDummyParentMod(FabricMod host, String id) { } @Override - public @NotNull SortedMap> getCredits() { + public @NotNull SortedMap> getCredits() { return new TreeMap<>(); } diff --git a/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricMod.java b/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricMod.java index 2c89e9e5..9016ba11 100644 --- a/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricMod.java +++ b/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricMod.java @@ -222,16 +222,19 @@ public FabricMod(ModContainer modContainer, Set modpackMods) { } @Override - public @NotNull SortedMap> getCredits() { - SortedMap> credits = new TreeMap<>(); + public @NotNull SortedMap> getCredits() { + SortedMap> credits = new TreeMap<>(); var authors = this.getAuthors(); - var contributors = this.getContributors(); + // Preserve order of original author array + credits.put("Author", new LinkedHashSet<>()); for (var author : authors) { - contributors.put(author, List.of("Author")); + credits.get("Author").add(author); } + var contributors = this.getContributors(); + for (var contributor : contributors.entrySet()) { for (var role : contributor.getValue()) { credits.computeIfAbsent(role, key -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER)); diff --git a/src/main/java/com/terraformersmc/modmenu/util/mod/quilt/QuiltMod.java b/src/main/java/com/terraformersmc/modmenu/util/mod/quilt/QuiltMod.java index ae69ba2e..b948b28a 100644 --- a/src/main/java/com/terraformersmc/modmenu/util/mod/quilt/QuiltMod.java +++ b/src/main/java/com/terraformersmc/modmenu/util/mod/quilt/QuiltMod.java @@ -70,8 +70,8 @@ public QuiltMod(net.fabricmc.loader.api.ModContainer fabricModContainer, Set> getCredits() { - SortedMap> credits = new TreeMap<>(); + public @NotNull SortedMap> getCredits() { + SortedMap> credits = new TreeMap<>(); var contributors = this.getContributors();