From 3673d6758ed9096bba293c0d697d7eecb5d4acb1 Mon Sep 17 00:00:00 2001 From: LemonCaramel Date: Sat, 5 Jun 2021 16:49:04 +0900 Subject: [PATCH] Fix Cannot be adventure component serialized when the legacy component is null (#5754) --- Spigot-Server-Patches/0010-Adventure.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/0010-Adventure.patch b/Spigot-Server-Patches/0010-Adventure.patch index 57bf64489..d871f43df 100644 --- a/Spigot-Server-Patches/0010-Adventure.patch +++ b/Spigot-Server-Patches/0010-Adventure.patch @@ -475,7 +475,7 @@ index 0000000000000000000000000000000000000000..caa9708f321f04cd02534161231c0599 +} diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java new file mode 100644 -index 0000000000000000000000000000000000000000..c60457e9240c33a4721b82a00cef081fb320c8a7 +index 0000000000000000000000000000000000000000..7b14b3c2486f03778d4673cf9684aa576dc2724a --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java @@ -0,0 +1,344 @@ @@ -606,7 +606,7 @@ index 0000000000000000000000000000000000000000..c60457e9240c33a4721b82a00cef081f + // 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 asAdventure(final List vanillas) {