From 362a21a4b1a9130e28aee71ba402cd433a255f39 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 29 Oct 2021 10:59:59 -0400 Subject: [PATCH] Use Jitpack for Adventure to fix boolean string serialization Fixes #2596 --- connector/pom.xml | 21 +++++++++++++++++-- .../translators/nbt/BasicItemTranslator.java | 6 +++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/connector/pom.xml b/connector/pom.xml index c65e73b51..c12c0d24f 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -11,7 +11,7 @@ connector - 4.9.2 + 3d6eaaf63f 8.5.2 2.12.4 4.1.66.Final @@ -160,6 +160,10 @@ com.github.steveice10 mcauthlib + + net.kyori + * + @@ -223,7 +227,20 @@ - net.kyori + com.github.KyoriPowered.adventure + adventure-text-serializer-gson + ${adventure.version} + compile + + + com.github.KyoriPowered.adventure + adventure-text-serializer-gson-legacy-impl + ${adventure.version} + compile + + + + com.github.KyoriPowered.adventure adventure-text-serializer-legacy ${adventure.version} compile diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/item/translators/nbt/BasicItemTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/item/translators/nbt/BasicItemTranslator.java index 58d72de0e..b6b1dfac6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/item/translators/nbt/BasicItemTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/item/translators/nbt/BasicItemTranslator.java @@ -56,10 +56,10 @@ public class BasicItemTranslator extends NbtItemStackTranslator { return; } - ListTag loreTag = displayTag.get("Lore"); - if (loreTag != null) { + Tag loreTag = displayTag.get("Lore"); + if (loreTag instanceof ListTag listTag) { List lore = new ArrayList<>(); - for (Tag tag : loreTag.getValue()) { + for (Tag tag : listTag.getValue()) { if (!(tag instanceof StringTag)) continue; lore.add(new StringTag("", MessageTranslator.convertMessageLenient(((StringTag) tag).getValue(), session.getLocale()))); }