ProtocolLib

3M Downloads

IllegalArgumentException - Receiving all sounds from NAMED_SOUND_EFFECT packet

MiraculixxT opened this issue ยท 2 comments

commented
  • This issue is not solved in a development build (using latest dev build in 1.19 paper)

Describe the bug
I listening to the NAMED_SOUND_EFFECT packet sended from the server to any clients. Afterwards i try to receive all sounds sended by the packet to work with them later (here, broadcasting their name and key).
Code -> https://hastebin.com/owafutogim.kotlin
Error -> https://hastebin.com/supetosove.properties

To Reproduce
Steps to reproduce the behavior:

  1. Listen to named packet
  2. Receiving all sounds from packet
  3. Trigger packet ingame

Expected behavior
A list of all sounds should be returned and broadcasted.

Version Info
https://hastebin.com/umagudacem.properties

commented

It seems that no information is inside the package at all...
I tried to access the sound names manually by getting all values inside the packet and filter them out, but apparently PacketContainer#strings returns an empty list. I added the ENTITY_SOUND packet to try it there but same result.

Is that broke in the current 1.19 build is there a other way to access the sound key/name/id?

Console Output
[] for every sound
Current Code

val listen = object : PacketAdapter(Manager, ListenerPriority.NORMAL, 
           PacketType.Play.Server.NAMED_SOUND_EFFECT, 
           PacketType.Play.Server.ENTITY_SOUND, 
           PacketType.Play.Server.CUSTOM_SOUND_EFFECT) {
        override fun onPacketSending(event: PacketEvent) {
            val packet = event.packet
            val anything = packet.strings.values
            broadcast(cmp("$anything"))
        }
    }
commented

Some response would be great. Currently this is the only issue that prevents me from updating all projects and server to 1.19 and i started using ProtocolLib to update faster