Skip to content

Commit

Permalink
Use correct class to get method in NMSUtil#sendPacket
Browse files Browse the repository at this point in the history
Closes #80
  • Loading branch information
FlorianMichael committed Apr 29, 2024
1 parent 8db6375 commit b95e035
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static void sendPacket(final Player player, final Object packet) {
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);
Expand Down

0 comments on commit b95e035

Please sign in to comment.