ProtocolLib

3M Downloads

Tutorial unclear or outdated

IamMusavaRibica 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
I was following the tutorial linked here https://dev.bukkit.org/projects/protocollib/pages/tutorial on my server, version 1.15.2. I have only ProtocolLib and my plugin in my plugins folder.

API method(s) used
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
ProtocolManager.addPacketListener()

@OverRide
public void onPacketSending(PacketEvent event)

PacketEvent.getPacketType()

Expected behavior
Sounds should be disabled and not heard (as stated in the tutorial)

Code
Simplified code: https://pastebin.com/7VbbyPTp

Additional context

  • I added ProtocolLib as a dependency
  • No errors get thrown
  • The event does get called, the if statement doesnt, i still hear the sounds. The logger info line returned this:
[17:08:26] [Server thread/INFO]: [PLibTest] A packet event received PacketEvent[player=CraftPlayer{name=musava_ribica}, packet=PacketContainer[type=NAMED_SOUND_EFFECT[class=PacketPlayOutNamedSoundEffect, id=82], structureModifier=StructureModifier[fieldType=class java.lang.Object, data=[private net.minecraft.server.v1_15_R1.SoundEffect net.minecraft.server.v1_15_R1.PacketPlayOutNamedSoundEffect.a, private net.minecraft.server.v1_15_R1.SoundCategory net.minecraft.server.v1_15_R1.PacketPlayOutNamedSoundEffect.b, private int net.minecraft.server.v1_15_R1.PacketPlayOutNamedSoundEffect.c, private int net.minecraft.server.v1_15_R1.PacketPlayOutNamedSoundEffect.d, private int net.minecraft.server.v1_15_R1.PacketPlayOutNamedSoundEffect.e, private float net.minecraft.server.v1_15_R1.PacketPlayOutNamedSoundEffect.f, private float net.minecraft.server.v1_15_R1.PacketPlayOutNamedSoundEffect.g]]]]