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..32176fb7 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 @@ -212,7 +212,7 @@ public FabricMod(ModContainer modContainer, Set modpackMods) { @Override public @NotNull Map> getContributors() { - Map> contributors = new HashMap<>(); + Map> contributors = new LinkedHashMap<>(); for (var contributor : this.metadata.getContributors()) { contributors.put(contributor.getName(), List.of("Contributor")); @@ -222,8 +222,8 @@ 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(); @@ -234,7 +234,7 @@ public FabricMod(ModContainer modContainer, Set modpackMods) { for (var contributor : contributors.entrySet()) { for (var role : contributor.getValue()) { - credits.computeIfAbsent(role, key -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER)); + credits.computeIfAbsent(role, key -> new LinkedHashSet<>()); credits.get(role).add(contributor.getKey()); } } 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..de7a2a63 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 @@ -15,17 +15,16 @@ import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.SortedMap; -import java.util.SortedSet; import java.util.TreeMap; -import java.util.TreeSet; import java.util.stream.Collectors; public class QuiltMod extends FabricMod { @@ -60,7 +59,7 @@ public QuiltMod(net.fabricmc.loader.api.ModContainer fabricModContainer, Set> getContributors() { - Map> contributors = new HashMap<>(); + Map> contributors = new LinkedHashMap<>(); for (var contributor : this.metadata.contributors()) { contributors.put(contributor.name(), contributor.roles()); @@ -70,14 +69,14 @@ 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(); for (var contributor : contributors.entrySet()) { for (var role : contributor.getValue()) { - credits.computeIfAbsent(role, key -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER)); + credits.computeIfAbsent(role, key -> new LinkedHashSet<>()); credits.get(role).add(contributor.getKey()); } }