Stack Overflow Error with latest spigot 1.14 jar and chat components.
dniym opened this issue ยท 6 comments
Follow this template except for feature requests. Use pastebin when providing /protocol dump and any relevant errors.
Make sure you've done the following:
[X ] You're using the latest build for your server version
[X ] This isn't an issue caused by another plugin
[X ] You've checked for duplicate issues
[X ] You didn't use /reload
Debug paste link:
https://hatebin.com/hkwihpjsqu <-- stack trace
https://hatebin.com/ksvmzqrtkq <-- Code to reproduce error
Description and relevant errors:
Whenever I attempt to interact with a specific packet I get a stack overflow error. This just recently started happening with a newer spigot version, its happening in 1.14 as well.
Anyways from the log you'll see debug1, and debug2, there should be a debug3 when that specific packet is sent triggering a debug3 which never appears. Normal chat components seem to get picked up by the listener just fine however; when the /branding command is typed into chat I get a stack overflow error when the listener picks up the server's response.
I think this has to do with Mojang wrapping chat components in an optional in 1.13.2. Should hopefully be an easy fix on ProtocolLib's end though
Okay, re-tested this out with the same code as linked above... Still getting an overflow error with the test packet that I created.
I modified the try statement as follows in the listener:
https://hatebin.com/hnzhpezvpn
heres the error:
https://hatebin.com/biyiczqtbi
Ah I misinterpreted what was going wrong there. The issue looks to be with trying to clone Spigot's chat components which are different from the internal NMS ones. I'll look into fixing that now.
Ugh, i'm still not having any luck with the test component I sent originally... When protocollib encounters it, the getChatComponents() method is empty, but with ones that don't have clickable links it seems to work fine...
Debugging Log:
https://hatebin.com/hawsphqbgp
Updated Code:
https://hatebin.com/sllroelqcr
Am I just going about this wrong? It worked fine before 1.13