1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-30 19:40:37 +01:00

Fix Cannot be adventure component serialized when the legacy component is null ()

This commit is contained in:
LemonCaramel 2021-06-05 16:49:04 +09:00
parent e5768e2b2b
commit edb4be1e28

View file

@ -606,7 +606,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Component
+
+ public static Component asAdventure(final IChatBaseComponent component) {
+ return GSON.serializer().fromJson(IChatBaseComponent.ChatSerializer.toJsonTree(component), Component.class);
+ return component == null ? Component.empty() : GSON.serializer().fromJson(IChatBaseComponent.ChatSerializer.toJsonTree(component), Component.class);
+ }
+
+ public static ArrayList<Component> asAdventure(final List<IChatBaseComponent> vanillas) {