LOOHP / InteractiveChat

Add click and hover events to chat messages!
https://www.spigotmc.org/resources/75870/
GNU General Public License v3.0
166 stars 26 forks source link

Using [item] disconects the player #165

Open ComicIvans opened 1 year ago

ComicIvans commented 1 year ago

I'm running three Purpur ervers with a Velocity proxy on Minecraft 1.20.1 and I have InteractiveChat installed on all backend servers with ProtocolLib, Vault, PlaceholderAPI and Bungeecord: true on the config files. Also I have InteractiveChat on Velocity and I'm using CarbonChat as chat manager.

Every InteractiveChat placeholder works fine except for [item]. When I try to send a message with the [item] placeholder, I get disconected from the server with the message: "Internal Exception: io.netty.handler.codec.DecoderException: Received unexpected null component". These are the logs I get on the proxy:

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at com.loohp.interactivechat.utils.NativeAdventureConverter.jsonStringToNative(NativeAdventureConverter.java:169)
... 12 more
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 4 column 414 path $.extra[4].hoverEvent.contents.tag
at com.google.gson.Gson.fromJson(Gson.java:1241)
at com.google.gson.Gson.fromJson(Gson.java:1186)
at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:181)
at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:74)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:204)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:1227)
at com.google.gson.Gson.fromJson(Gson.java:1186)
at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:177)
at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:74)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:204)
at com.google.gson.Gson.fromJson(Gson.java:1227)
at com.google.gson.Gson.fromJson(Gson.java:1137)
at com.google.gson.Gson.fromJson(Gson.java:1047)
at com.google.gson.Gson.fromJson(Gson.java:982)
at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserialize(GsonComponentSerializerImpl.java:87)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 14 more
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 4 column 414 path $.extra[4].hoverEvent.contents.tag
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1659)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:500)
at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:422)
at com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:779)
at com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:725)
at com.google.gson.internal.bind.TypeAdapters$34$1.read(TypeAdapters.java:1007)
at com.google.gson.Gson.fromJson(Gson.java:1227)
... 32 more

More info:

UPDATE: Setting HoverEnabled: false for the Item section in configuration file fixes this.

LOOHP commented 1 year ago

Probably something weird existing in the HoverEvent. Does this problem occur with all items or just some?

ComicIvans commented 1 year ago

Only with some items, here's what I've tried:

WORKS WITH:

DOESN'T WORK WITH: