Skip to content

Commit

Permalink
Keep API compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Nov 16, 2023
1 parent edeeb25 commit b327ba0
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cuchaz.enigma.command;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;

Expand Down Expand Up @@ -47,7 +48,7 @@ public static EntryTree<EntryMapping> read(String type, Path path, MappingSavePa
throw new IllegalArgumentException("no reader for " + type);
}

public static void write(EntryTree<EntryMapping> mappings, String type, Path path, MappingSaveParameters saveParameters) throws IOException {
public static void write(EntryTree<EntryMapping> mappings, String type, Path path, MappingSaveParameters saveParameters) {
if (type.equals("enigma")) {
MappingFormat.ENIGMA_DIRECTORY.write(mappings, path, ProgressListener.none(), saveParameters);
return;
Expand All @@ -64,9 +65,14 @@ public static void write(EntryTree<EntryMapping> mappings, String type, Path pat
new TinyV2Writer(split[1], split[2]).write(mappings, path, ProgressListener.none(), saveParameters);
return;
}

Check failure on line 68 in enigma-cli/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java

View workflow job for this annotation

GitHub Actions / build (17-jdk)

trailing whitespace

Check failure on line 68 in enigma-cli/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java

View workflow job for this annotation

GitHub Actions / build (19-jdk)

trailing whitespace
try {
VisitableMappingTree tree = MappingIoConverter.toMappingIo(mappings, ProgressListener.none(), split[1], split[2]);
tree.accept(MappingWriter.create(path, net.fabricmc.mappingio.format.MappingFormat.TINY_2_FILE));
} catch (IOException e) {
throw new UncheckedIOException(e);
}

VisitableMappingTree tree = MappingIoConverter.toMappingIo(mappings, ProgressListener.none(), split[1], split[2]);
tree.accept(MappingWriter.create(path, net.fabricmc.mappingio.format.MappingFormat.TINY_2_FILE));
return;
}

Expand All @@ -82,8 +88,13 @@ public static void write(EntryTree<EntryMapping> mappings, String type, Path pat
return;
}

VisitableMappingTree tree = MappingIoConverter.toMappingIo(mappings, ProgressListener.none(), split[1], split[2]);
tree.accept(MappingWriter.create(path, net.fabricmc.mappingio.format.MappingFormat.TINY_FILE));
try {
VisitableMappingTree tree = MappingIoConverter.toMappingIo(mappings, ProgressListener.none(), split[1], split[2]);
tree.accept(MappingWriter.create(path, net.fabricmc.mappingio.format.MappingFormat.TINY_FILE));
} catch (IOException e) {
throw new UncheckedIOException(e);
}

return;
}

Expand Down

0 comments on commit b327ba0

Please sign in to comment.