From 0d0e1c16ea63f9ef9a482edd6e71a86a3a3c8b49 Mon Sep 17 00:00:00 2001 From: Myles Date: Sat, 5 Mar 2016 23:24:23 +0000 Subject: [PATCH] Fix issue with formatting :) (fixes quotes) --- .../ViaVersion/transformers/OutgoingTransformer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java b/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java index 3d76e23a5..09564fffe 100644 --- a/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java +++ b/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java @@ -656,10 +656,14 @@ public class OutgoingTransformer { if (line == null || line.equalsIgnoreCase("null")) { line = "{\"text\":\"\"}"; } else { - if (!line.startsWith("\"") && !line.startsWith("{")) - line = "\"" + line + "\""; - if (line.startsWith("\"")) + if (!line.startsWith("\"") && !line.startsWith("{")) { + JSONObject obj = new JSONObject(); + obj.put("text", line); + line = obj.toJSONString(); + } + if (line.startsWith("\"")) { line = "{\"text\":" + line + "}"; + } } try { new JSONParser().parse(line);