Skip to content

Commit 9ad11d2

Browse files
committed
Prevent duplicate mod IDs in loader metadata
Fixes #63
1 parent e9154ae commit 9ad11d2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/dev/su5ed/sinytra/connector/loader/ConnectorLoaderModMetadata.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ public String getType() {
123123
@Override
124124
public Collection<String> getProvides() {
125125
Set<String> provides = new HashSet<>(this.wrapped.getProvides());
126+
String normalized = getId();
127+
// Remove normalized modid from provided ids to prevent duplicates
128+
provides.remove(normalized);
129+
// If we modified the modid, provide the original
126130
String original = this.wrapped.getId();
127-
if (!getId().equals(original)) {
131+
if (!normalized.equals(original)) {
128132
// Add original modid to mod lookup
129133
provides.add(original);
130134
}

0 commit comments

Comments
 (0)