Giter Site home page Giter Site logo

Comments (5)

astei avatar astei commented on June 7, 2024

Unclear what you're referring to here. The toString() output looks correct to me - the BungeeCord text serializer works by "laundering" an Adventure Component such that when serialized by ComponentSerializer.toString() it will produce the Adventure component.

Does the output of GsonComponentSerializer.gson().serialize() on the original component and ComponentSerializer.toString() on the BaseComponent returned by BungeeComponentSerializer disagree with each other?

from adventure-platform.

Foorcee avatar Foorcee commented on June 7, 2024
        System.out.println(GsonComponentSerializer.gson().serialize(input.getMessage()));
        BaseComponent[] components = BungeeComponentSerializer.get().serialize(input.getMessage());
        System.out.println(ComponentSerializer.toString(components));
[12:40:43 INFO]: {"extra":[{"color":"gray","text":"Schreibe den Betrag, welchen du auf dein "},{"color":"gold","text":"Konto einzahlen "},{"color":"gray","text":"möchtest, in den Chat."}],"text":""}
[12:40:43 ERROR]: Could not pass event InventoryClickEvent to Reallife-Spawn v1.0
java.lang.reflect.InaccessibleObjectException: Unable to make field int java.awt.Color.value accessible: module java.desktop does not "opens java.awt" to unnamed module @2a79781f
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) ~[?:?]
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[?:?]
at java.lang.reflect.Field.checkCanSetAccessible(Field.java:177) ~[?:?]
at java.lang.reflect.Field.setAccessible(Field.java:171) ~[?:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:157) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.Gson.getAdapter(Gson.java:423) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.Gson.getAdapter(Gson.java:423) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.Gson.getDelegateAdapter(Gson.java:506) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.kyori.adventure.text.serializer.bungeecord.SelfSerializable$AdapterFactory.create(SelfSerializable.java:58) ~[adventure-text-serializer-bungeecord-4.0.0-SNAPSHOT.jar:?]
at com.google.gson.Gson.getAdapter(Gson.java:423) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.Gson.toJson(Gson.java:661) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.Gson.toJson(Gson.java:648) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.Gson.toJson(Gson.java:603) ~[spigot.jar:git-Tuinity-"2683c77"]
at com.google.gson.Gson.toJson(Gson.java:583) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.md_5.bungee.chat.ComponentSerializer.toString(ComponentSerializer.java:76) ~[spigot.jar:git-Tuinity-"2683c77"]
at de.cytooxien.reallife.phantom.chat.LabyModPromptInputListener.openInputScreen(LabyModPromptInputListener.java:88) ~[?:?]
at de.cytooxien.reallife.phantom.chat.LabyModPromptInputListener.sendPrompt(LabyModPromptInputListener.java:34) ~[?:?]
at de.cytooxien.reallife.phantom.chat.PlayerChatInputManager.handlePlayerChatInput(PlayerChatInputManager.java:73) ~[?:?]
at de.cytooxien.reallife.phantom.chat.PlayerChatInput.buildFuture(PlayerChatInput.java:107) ~[?:?]
at de.cytooxien.reallife.commons.ghetto.CashTransactionInventory.handleInput(CashTransactionInventory.java:99) ~[?:?]
at de.cytooxien.reallife.commons.ghetto.CashTransactionInventory.lambda$onUpdateInventory$3(CashTransactionInventory.java:64) ~[?:?]
at de.cytooxien.reallife.phantom.inventory.InventoryHandler.onInventoryClick(InventoryHandler.java:177) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor626.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[spigot.jar:git-Tuinity-"2683c77"]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[spigot.jar:git-Tuinity-"2683c77"]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot.jar:git-Tuinity-"2683c77"]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:2797) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.PacketPlayInWindowClick.a(SourceFile:32) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.PacketPlayInWindowClick.a(SourceFile:10) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:55) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1325) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1318) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1294) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1138) ~[spigot.jar:git-Tuinity-"2683c77"]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:292) ~[spigot.jar:git-Tuinity-"2683c77"]
at java.lang.Thread.run(Thread.java:831) [?:?]```

from adventure-platform.

A248 avatar A248 commented on June 7, 2024

As an aside, it may be a good idea to override AdapterComponent#toString, to ease future debugging on the matter and reduce confusion arising from the toString output.

from adventure-platform.

kashike avatar kashike commented on June 7, 2024

This is caused by the bungeecord-chat library using java.awt.Color internally.

https://bugs.openjdk.java.net/browse/JDK-8256358

from adventure-platform.

zml2008 avatar zml2008 commented on June 7, 2024

This was already fixed in 1129e6e in December 2020, stop using severely outdated versions of -platform.

from adventure-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.