diff options
| author | 2023-11-16 13:51:03 +0100 | |
|---|---|---|
| committer | 2023-11-16 13:51:03 +0100 | |
| commit | 423f5cf98c6d419942301cca0c7c8169db8d4b30 (patch) | |
| tree | a7cd6a6ab02f929e8e07930dabe130e6202dfdf7 /enigma-cli/src/main/java | |
| parent | Allow XSRG and CSRG to be imported (diff) | |
| download | enigma-423f5cf98c6d419942301cca0c7c8169db8d4b30.tar.gz enigma-423f5cf98c6d419942301cca0c7c8169db8d4b30.tar.xz enigma-423f5cf98c6d419942301cca0c7c8169db8d4b30.zip | |
Fix importing mappings without field source descriptors
Diffstat (limited to 'enigma-cli/src/main/java')
| -rw-r--r-- | enigma-cli/src/main/java/cuchaz/enigma/command/Command.java | 4 | ||||
| -rw-r--r-- | enigma-cli/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/enigma-cli/src/main/java/cuchaz/enigma/command/Command.java b/enigma-cli/src/main/java/cuchaz/enigma/command/Command.java index ef7cfaa5..de06fa6e 100644 --- a/enigma-cli/src/main/java/cuchaz/enigma/command/Command.java +++ b/enigma-cli/src/main/java/cuchaz/enigma/command/Command.java | |||
| @@ -58,7 +58,7 @@ public abstract class Command { | |||
| 58 | protected static EntryTree<EntryMapping> readMappings(Path path, ProgressListener progress, MappingSaveParameters saveParameters) throws IOException, MappingParseException { | 58 | protected static EntryTree<EntryMapping> readMappings(Path path, ProgressListener progress, MappingSaveParameters saveParameters) throws IOException, MappingParseException { |
| 59 | // Legacy | 59 | // Legacy |
| 60 | if ("zip".equalsIgnoreCase(MoreFiles.getFileExtension(path))) { | 60 | if ("zip".equalsIgnoreCase(MoreFiles.getFileExtension(path))) { |
| 61 | return MappingFormat.ENIGMA_ZIP.read(path, progress, saveParameters); | 61 | return MappingFormat.ENIGMA_ZIP.read(path, progress, saveParameters, null); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | net.fabricmc.mappingio.format.MappingFormat format = MappingReader.detectFormat(path); | 64 | net.fabricmc.mappingio.format.MappingFormat format = MappingReader.detectFormat(path); |
| @@ -66,7 +66,7 @@ public abstract class Command { | |||
| 66 | 66 | ||
| 67 | VisitableMappingTree tree = new MemoryMappingTree(); | 67 | VisitableMappingTree tree = new MemoryMappingTree(); |
| 68 | MappingReader.read(path, format, tree); | 68 | MappingReader.read(path, format, tree); |
| 69 | return MappingIoConverter.fromMappingIo(tree, progress); | 69 | return MappingIoConverter.fromMappingIo(tree, progress, null); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | protected static File getWritableFile(String path) { | 72 | protected static File getWritableFile(String path) { |
diff --git a/enigma-cli/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java b/enigma-cli/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java index c452d8ca..2c6c9fdb 100644 --- a/enigma-cli/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java +++ b/enigma-cli/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java | |||
| @@ -23,11 +23,11 @@ public final class MappingCommandsUtil { | |||
| 23 | 23 | ||
| 24 | public static EntryTree<EntryMapping> read(String type, Path path, MappingSaveParameters saveParameters) throws MappingParseException, IOException { | 24 | public static EntryTree<EntryMapping> read(String type, Path path, MappingSaveParameters saveParameters) throws MappingParseException, IOException { |
| 25 | if (type.equals("enigma")) { | 25 | if (type.equals("enigma")) { |
| 26 | return (Files.isDirectory(path) ? MappingFormat.ENIGMA_DIRECTORY : MappingFormat.ENIGMA_ZIP).read(path, ProgressListener.none(), saveParameters); | 26 | return (Files.isDirectory(path) ? MappingFormat.ENIGMA_DIRECTORY : MappingFormat.ENIGMA_ZIP).read(path, ProgressListener.none(), saveParameters, null); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | if (type.equals("tiny")) { | 29 | if (type.equals("tiny")) { |
| 30 | return MappingFormat.TINY_FILE.read(path, ProgressListener.none(), saveParameters); | 30 | return MappingFormat.TINY_FILE.read(path, ProgressListener.none(), saveParameters, null); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | MappingFormat format = null; | 33 | MappingFormat format = null; |
| @@ -41,7 +41,7 @@ public final class MappingCommandsUtil { | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | if (format != null) { | 43 | if (format != null) { |
| 44 | return format.read(path, ProgressListener.none(), saveParameters); | 44 | return format.read(path, ProgressListener.none(), saveParameters, null); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | throw new IllegalArgumentException("no reader for " + type); | 47 | throw new IllegalArgumentException("no reader for " + type); |