diff --git a/chat/src/main/java/net/md_5/bungee/chat/ComponentSerializer.java b/chat/src/main/java/net/md_5/bungee/chat/ComponentSerializer.java index 5756fc4a..da801828 100644 --- a/chat/src/main/java/net/md_5/bungee/chat/ComponentSerializer.java +++ b/chat/src/main/java/net/md_5/bungee/chat/ComponentSerializer.java @@ -39,12 +39,17 @@ public class ComponentSerializer implements JsonDeserializer public static String toString(BaseComponent component) { - return gson.toJson( component ); + // 1.9 Requires the first component to not be a plain string which can + // happen if a text component has no formatting. This optimization is + // still useful when nested more so we just manually wrap everything in + // an extra text component. + return "{\"text\":\"\", \"extra\": [" + gson.toJson( component ) + "]}"; } public static String toString(BaseComponent... components) { - return gson.toJson( new TextComponent( components ) ); + // See above + return "{\"text\":\"\", \"extra\": [" + gson.toJson( new TextComponent( components ) ) + "]}"; } @Override