Skip to content

Commit f32a7a6

Browse files
committed
Ensure antioverlap modids are in the same order every time.
Should fix Quark's config file being perpetually "incorrect" according to Forge
1 parent 492efd1 commit f32a7a6

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/main/java/org/violetmoon/zeta/module/TentativeModule.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package org.violetmoon.zeta.module;
22

3-
import org.apache.commons.lang3.text.WordUtils;
4-
import org.violetmoon.zeta.util.ZetaSide;
5-
3+
import java.util.List;
64
import java.util.Locale;
7-
import java.util.Set;
5+
import java.util.SortedSet;
6+
import java.util.TreeSet;
87
import java.util.function.Function;
98

9+
import org.apache.commons.lang3.text.WordUtils;
10+
import org.violetmoon.zeta.util.ZetaSide;
11+
1012
/**
1113
* performs some common data-munging of the data straight off a ZetaLoadModule annotation
1214
*/
@@ -18,7 +20,7 @@ public record TentativeModule(
1820
String displayName,
1921
String lowercaseName,
2022
String description,
21-
Set<String> antiOverlap,
23+
SortedSet<String> antiOverlap,
2224
boolean enabledByDefault,
2325

2426
boolean clientReplacement,
@@ -62,7 +64,7 @@ public static TentativeModule from(ZetaLoadModuleAnnotationData data, Function<S
6264
displayName,
6365
lowercaseName,
6466
data.description(),
65-
Set.of(data.antiOverlap()),
67+
new TreeSet<>(List.of(data.antiOverlap())),
6668
data.enabledByDefault(),
6769
clientReplacement,
6870
data.loadPhase()

src/main/java/org/violetmoon/zeta/module/ZetaModule.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package org.violetmoon.zeta.module;
22

3+
import java.util.List;
4+
import java.util.SortedSet;
5+
import java.util.TreeSet;
6+
37
import org.jetbrains.annotations.ApiStatus;
48
import org.violetmoon.zeta.Zeta;
59
import org.violetmoon.zeta.event.bus.LoadEvent;
610
import org.violetmoon.zeta.event.load.ZGatherHints;
711

8-
import java.util.List;
9-
import java.util.Set;
10-
1112
public class ZetaModule {
1213

1314
//all these are just to notify that these will go package private soon. Should be read only! Cant make them final because module is initialized with reflections
@@ -24,7 +25,8 @@ public class ZetaModule {
2425
@Deprecated(forRemoval = true)
2526
public String description = "";
2627

27-
protected Set<String> antiOverlap = Set.of();
28+
//This gets dumped into a config comment; ordering must be consistent lest Forge complain the config file is "incorrect"
29+
protected SortedSet<String> antiOverlap = new TreeSet<>();
2830

2931
@Deprecated(forRemoval = true)
3032
public boolean enabled = false;

0 commit comments

Comments
 (0)