File tree 1 file changed +17
-0
lines changed
chat/src/main/java/net/md_5/bungee/chat
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 20
20
import net .md_5 .bungee .api .chat .SelectorComponent ;
21
21
import net .md_5 .bungee .api .chat .TextComponent ;
22
22
import net .md_5 .bungee .api .chat .TranslatableComponent ;
23
+ import net .md_5 .bungee .api .chat .hover .content .Content ;
23
24
import net .md_5 .bungee .api .chat .hover .content .Entity ;
24
25
import net .md_5 .bungee .api .chat .hover .content .EntitySerializer ;
25
26
import net .md_5 .bungee .api .chat .hover .content .Item ;
@@ -158,11 +159,27 @@ public static JsonElement toJson(ComponentStyle style)
158
159
return gson .toJsonTree ( style );
159
160
}
160
161
162
+ /**
163
+ * @param object the object to serialize
164
+ * @return the JSON string representation of the object
165
+ * @deprecated Error-prone, be careful which object you input here
166
+ */
167
+ @ Deprecated
161
168
public static String toString (Object object )
162
169
{
163
170
return gson .toJson ( object );
164
171
}
165
172
173
+ public static String toString (Content content )
174
+ {
175
+ return gson .toJson ( content );
176
+ }
177
+
178
+ public static String toString (JsonElement element )
179
+ {
180
+ return gson .toJson ( element );
181
+ }
182
+
166
183
public static String toString (BaseComponent component )
167
184
{
168
185
return gson .toJson ( component );
You can’t perform that action at this time.
0 commit comments