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 1164804f..15ffc1ee 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 @@ -20,6 +20,7 @@ import net.md_5.bungee.api.chat.ScoreComponent; import net.md_5.bungee.api.chat.SelectorComponent; import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TranslatableComponent; +import net.md_5.bungee.api.chat.hover.content.Content; import net.md_5.bungee.api.chat.hover.content.Entity; import net.md_5.bungee.api.chat.hover.content.EntitySerializer; import net.md_5.bungee.api.chat.hover.content.Item; @@ -158,11 +159,28 @@ public class ComponentSerializer implements JsonDeserializer return gson.toJsonTree( style ); } + /** + * @param object the object to serialize + * @return the JSON string representation of the object + * @deprecated Error-prone, be careful which object you input here + */ + @Deprecated public static String toString(Object object) { return gson.toJson( object ); } + /** + * @param content the content to serialize + * @return the JSON string representation of the object + * @deprecated for legacy internal use only + */ + @Deprecated + public static String toString(Content content) + { + return gson.toJson( content ); + } + public static String toString(BaseComponent component) { return gson.toJson( component );