Use correct class to get method in NMSUtil#sendPacket

Closes https://github.com/ViaVersion/ViaRewind-Legacy-Support/issues/80
This commit is contained in:
FlorianMichael 2024-04-29 14:32:58 +02:00
parent 8db6375a8e
commit b95e03512e
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ public class NMSUtil {
return;
}
try {
final Method sendPacket = ReflectionUtil.findMethod(player.getClass(), new String[] {"sendPacket", "a"}, getPacketClass());
final Method sendPacket = ReflectionUtil.findMethod(playerConnection.getClass(), new String[] {"sendPacket", "a"}, getPacketClass());
sendPacket.invoke(playerConnection, packet);
} catch (IllegalAccessException | InvocationTargetException | NullPointerException e) {
BukkitPlugin.getInstance().getLogger().log(Level.SEVERE, "Failed to send packet to player", e);