Use Jitpack for Adventure to fix boolean string serialization

Fixes #2596
This commit is contained in:
Camotoy 2021-10-29 10:59:59 -04:00
parent a257211b01
commit 362a21a4b1
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
2 changed files with 22 additions and 5 deletions

View file

@ -11,7 +11,7 @@
<artifactId>connector</artifactId>
<properties>
<adventure.version>4.9.2</adventure.version>
<adventure.version>3d6eaaf63f</adventure.version>
<fastutil.version>8.5.2</fastutil.version>
<jackson.version>2.12.4</jackson.version>
<netty.version>4.1.66.Final</netty.version>
@ -160,6 +160,10 @@
<groupId>com.github.steveice10</groupId>
<artifactId>mcauthlib</artifactId>
</exclusion>
<exclusion> <!-- TEMPORARY -->
<groupId>net.kyori</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@ -223,7 +227,20 @@
</dependency>
<!-- Adventure text serialization -->
<dependency>
<groupId>net.kyori</groupId>
<groupId>com.github.KyoriPowered.adventure</groupId>
<artifactId>adventure-text-serializer-gson</artifactId> <!-- TEMPORARY until https://github.com/KyoriPowered/adventure/commit/3d6eaaf63f44ddd981a4b3bbb1e0018aa6252da8 is in release -->
<version>${adventure.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.KyoriPowered.adventure</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId> <!-- TEMPORARY until https://github.com/KyoriPowered/adventure/commit/3d6eaaf63f44ddd981a4b3bbb1e0018aa6252da8 is in release -->
<version>${adventure.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<!-- <groupId>net.kyori</groupId>-->
<groupId>com.github.KyoriPowered.adventure</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>${adventure.version}</version>
<scope>compile</scope>

View file

@ -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<Tag> 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())));
}