Skip to content

Commit

Permalink
Add support for .tsrg mappings (McpConfig)
Browse files Browse the repository at this point in the history
  • Loading branch information
hYdos committed Dec 4, 2021
1 parent f710945 commit 8e33846
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "net.legacyfabric"
version = "1.0.0"
version = "1.0.1"

repositories {
mavenCentral()
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/net/legacyfabric/mcpmatcher/util/MappingUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ private static void readJarFile(Path jarFile, SignatureVisitor visitor) throws I
}

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

private static class SignatureVisitor extends ClassVisitor {
Expand Down

0 comments on commit 8e33846

Please sign in to comment.