Fix Cannot be adventure component serialized when the legacy component is null (#5754)
This commit is contained in:
parent
e5768e2b2b
commit
edb4be1e28
1 changed files with 1 additions and 1 deletions
|
@ -606,7 +606,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ // Component
|
+ // Component
|
||||||
+
|
+
|
||||||
+ public static Component asAdventure(final IChatBaseComponent 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) {
|
+ public static ArrayList<Component> asAdventure(final List<IChatBaseComponent> vanillas) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue