mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
Refactor SrgNamedWriter
This commit is contained in:
@@ -183,7 +183,7 @@ public class MappingsProvider extends DependencyProvider {
|
||||
}
|
||||
|
||||
if (!srgToNamedSrg.exists() || isRefreshDeps()) {
|
||||
SrgNamedWriter.writeTo(getProject().getLogger(), srgToNamedSrg.toPath(), getMappingsWithSrg());
|
||||
SrgNamedWriter.writeTo(getProject().getLogger(), srgToNamedSrg.toPath(), getMappingsWithSrg(), "srg", "named");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class SrgNamedWriter {
|
||||
public static void writeTo(Logger logger, Path srgFile, TinyTree mappings) throws IOException {
|
||||
public static void writeTo(Logger logger, Path srgFile, TinyTree mappings, String from, String to) throws IOException {
|
||||
Files.deleteIfExists(srgFile);
|
||||
try (SrgWriter writer = new SrgWriter(Files.newBufferedWriter(srgFile))) {
|
||||
try (TinyMappingsReader reader = new TinyMappingsReader(mappings, "srg", "named")) {
|
||||
try (TinyMappingsReader reader = new TinyMappingsReader(mappings, from, to)) {
|
||||
writer.write(reader.read());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user