ProtocolLib

3M Downloads

PLAYER_INFO issue

Opened this issue ยท 0 comments

commented

Make sure you're doing the following

  • You're using the latest build for your server version
  • This isn't an issue caused by another plugin
  • You've checked for duplicate issues
  • You didn't use /reload

Describe the question
Hello, I am trying to override (using listener) the display name of player info packets, so it would replace some strings with my own. As a side effect I realized I can add using this support to pre-1.16 server for RGB colors, which I already got working for chat etc.

HOWEVER here comes the issue: PlayerInfoData wrapper uses WrappedChatComponent that breaks the RGB functionality and thus I have to avoid it. I got it working previously with BaseComponent[] on other packets.

QUESTION: Is there any way to replace WrappedChatComponent in PlayerInfoData with BaseComponent[] or simply any other way I can edit the packet's data without using the non-rgb serializer that WrappedChatComponent uses?

API method(s) used
PacketContainer#getPlayerInfoDataList
WrappedChatComponent#fromJson - this performs the downsampling or in other way breaks RGB colors on pre-1.16 servers and I need to get a way around it.

Expected behavior
The chat component part in PlayerInfoData should correctly send RGB colors. Either I should be able to use BaseComponent[] or somehow make WrappedChatComponent work.