Fixed NBTTagString.toString not properly escaping \'s. Closes #2393

This commit is contained in:
LexManos 2016-05-28 22:30:09 -07:00
parent 93be22fc8e
commit 772e7da3a3
1 changed files with 10 additions and 0 deletions

View File

@ -9,3 +9,13 @@
}
public byte func_74732_a()
@@ -42,7 +42,8 @@
public String toString()
{
- return "\"" + this.field_74751_a.replace("\"", "\\\"") + "\"";
+ // Forge: BugFix: Vanilla does a normal " -> \" conversion but doesn't escape \
+ return "\"" + org.apache.commons.lang3.StringUtils.replaceEach(this.field_74751_a, new String[]{"\\","\""}, new String[]{"\\\\","\\\""}) + "\"";
}
public NBTBase func_74737_b()