Skip to content

Commit

Permalink
Fixed newline
Browse files Browse the repository at this point in the history
  • Loading branch information
ichttt committed Apr 26, 2020
1 parent 02d83a9 commit 617be6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/ichttt/mclang2json/Lang2JsonConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.nio.file.Paths;

public class Lang2JsonConverter {
public static final String VERSION = "1.8";
public static final String VERSION = "1.9";
public enum FileParseResult {
SUCCESS, NO_LANG_FILES, ABORT, ERRORS
}
Expand Down Expand Up @@ -150,7 +150,7 @@ private static void parse(File file, File output, boolean keepComments, String m
else
System.out.println("Remapping key " + split[0] + " to " + key);

writer.name(key).value(split[1]);
writer.name(key).value(fixupNewline(split[1]));
if (extraIndent) {
extraIndent = false;
writer.setIndent(BASE_INTENT);
Expand All @@ -164,6 +164,10 @@ private static void parse(File file, File output, boolean keepComments, String m
}
}

private static String fixupNewline(String s) {
return s.replace("\\n", "\n");
}

private static String remapKey(String key, String modId) {
if (key.startsWith("item.") && key.endsWith(".name")) {
StringBuilder buf = new StringBuilder("item.");
Expand Down

0 comments on commit 617be6f

Please sign in to comment.