diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java b/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java index bacb8ff..fc68edf 100644 --- a/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java +++ b/src/main/java/cuchaz/enigma/command/MappingCommandsUtil.java | |||
| @@ -91,7 +91,11 @@ public final class MappingCommandsUtil { | |||
| 91 | MappingFormat format = null; | 91 | MappingFormat format = null; |
| 92 | try { | 92 | try { |
| 93 | format = MappingFormat.valueOf(type.toUpperCase()); | 93 | format = MappingFormat.valueOf(type.toUpperCase()); |
| 94 | } catch (IllegalArgumentException ignored) {} | 94 | } catch (IllegalArgumentException ignored) { |
| 95 | if (type.equals("tinyv2")) { | ||
| 96 | format = MappingFormat.TINY_V2; | ||
| 97 | } | ||
| 98 | } | ||
| 95 | 99 | ||
| 96 | if (format != null) { | 100 | if (format != null) { |
| 97 | return format.getReader().read(path, ProgressListener.none(), saveParameters); | 101 | return format.getReader().read(path, ProgressListener.none(), saveParameters); |
| @@ -106,7 +110,18 @@ public final class MappingCommandsUtil { | |||
| 106 | return; | 110 | return; |
| 107 | } | 111 | } |
| 108 | 112 | ||
| 109 | if (type.startsWith("tiny")) { | 113 | if (type.startsWith("tinyv2:") || type.startsWith("tiny_v2:")) { |
| 114 | String[] split = type.split(":"); | ||
| 115 | |||
| 116 | if (split.length != 3) { | ||
| 117 | throw new IllegalArgumentException("specify column names as 'tinyv2:from_namespace:to_namespace'"); | ||
| 118 | } | ||
| 119 | |||
| 120 | new TinyV2Writer(split[1], split[2]).write(mappings, path, ProgressListener.none(), saveParameters); | ||
| 121 | return; | ||
| 122 | } | ||
| 123 | |||
| 124 | if (type.startsWith("tiny:")) { | ||
| 110 | String[] split = type.split(":"); | 125 | String[] split = type.split(":"); |
| 111 | 126 | ||
| 112 | if (split.length != 3) { | 127 | if (split.length != 3) { |