3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-10-08 11:10:06 +02:00

Fix issue with formatting :) (fixes quotes)

Dieser Commit ist enthalten in:
Myles 2016-03-05 23:24:23 +00:00
Ursprung f462ff9e8a
Commit 0d0e1c16ea

Datei anzeigen

@ -656,10 +656,14 @@ public class OutgoingTransformer {
if (line == null || line.equalsIgnoreCase("null")) { if (line == null || line.equalsIgnoreCase("null")) {
line = "{\"text\":\"\"}"; line = "{\"text\":\"\"}";
} else { } else {
if (!line.startsWith("\"") && !line.startsWith("{")) if (!line.startsWith("\"") && !line.startsWith("{")) {
line = "\"" + line + "\""; JSONObject obj = new JSONObject();
if (line.startsWith("\"")) obj.put("text", line);
line = obj.toJSONString();
}
if (line.startsWith("\"")) {
line = "{\"text\":" + line + "}"; line = "{\"text\":" + line + "}";
}
} }
try { try {
new JSONParser().parse(line); new JSONParser().parse(line);