Skip to content

Commit 8e33846

Browse files
committed
Add support for .tsrg mappings (McpConfig)
1 parent f710945 commit 8e33846

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = "net.legacyfabric"
9-
version = "1.0.0"
9+
version = "1.0.1"
1010

1111
repositories {
1212
mavenCentral()

src/main/java/net/legacyfabric/mcpmatcher/util/MappingUtils.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ private static void readJarFile(Path jarFile, SignatureVisitor visitor) throws I
4343
}
4444

4545
public static MappingSet readMappingsFile(String arg) throws IOException {
46-
//TODO: could use a map here and support more formats.
47-
if (arg.endsWith(".csrg")) {
48-
return MappingFormats.CSRG.read(Paths.get(arg));
49-
} else {
50-
return MappingFormats.SRG.read(Paths.get(arg));
51-
}
46+
return switch (arg.split("\\.")[1]) {
47+
case "csrg" -> MappingFormats.CSRG.read(Paths.get(arg));
48+
case "tsrg" -> MappingFormats.TSRG.read(Paths.get(arg));
49+
default -> MappingFormats.SRG.read(Paths.get(arg));
50+
};
5251
}
5352

5453
private static class SignatureVisitor extends ClassVisitor {

0 commit comments

Comments
 (0)