ProtocolLib

3M Downloads

WrappedServerPing changes aren't applied in 1.19.4

MrUniverse44 opened this issue ยท 2 comments

commented

Describe the bug
Changes in WrappedServerPing are not applied in version 1.19.4

To Reproduce

Listener code:
Link: https://github.com/ShieldCommunity/PixelMOTD/blob/master/src/main/java/me/blueslime/pixelmotd/listener/bukkit/packets/PacketListener.java

WrappedServerPing code:
https://github.com/ShieldCommunity/PixelMOTD/blob/master/src/main/java/me/blueslime/pixelmotd/motd/platforms/ProtocolPing.java

I was debugging the event. and The event is called, the WrappedServerPing is not null, but if i modify it, changes aren't applied
in this code, if the debug mode is enabled, everything is fine in console, and the code works in others versions but in the 1.19.4 the same code doesn't work.

Screenshots
Code used in this screenshots: Click Here

Result in a 1.19.4 server:
1.19.4 Result
1.19.4 Result

Same code and configuration, result in a 1.19 server:
1.19 Result
1.19 Result
1.19 Result

Listener Info

me.blueslime.pixelmotd.listener.bukkit.packets.PacketListener@30832649[
  playerVersionHandler=me.blueslime.pixelmotd.version.player.handlers.ProtocolLib@7249617e
  builder=me.blueslime.pixelmotd.motd.platforms.ProtocolPing@23898878
  hasOutdatedClient=false
  hasOutdatedServer=false
  isWhitelisted=false
  isBlacklisted=false
  MIN_PROTOCOL=47
  MAX_PROTOCOL=760
  unknown=unknown#1
  plugin=me.blueslime.pixelmotd.PixelMOTD@1890c095
  plugin=PixelMOTD v9.3.9-SNAPSHOT
  connectionSide=SERVER_SIDE
  receivingWhitelist=EMPTY_WHITELIST
  sendingWhitelist=ListeningWhitelist[priority=HIGHEST, packets=[SERVER_INFO[class=PacketStatusOutServerInfo, id=0]], gamephase=PLAYING, options=[]]
]

Plugins Using ProtocolLib:
PixelMOTD by [JustJustin]

Used ProtocolLib version: ProtocolLib v5.0.0-SNAPSHOT-636

commented

Yup, it works.

commented

I assume the new ServerPing Implementation returns a mutable copy of the actual ping data. Try writing back your changed ping, i.e., by adding

event.getPacket().getServerPings().write(0, png);

in ProtocolPing:194

Related: #2268