Fix NMSUtil#sendPacket

Closes https://github.com/ViaVersion/ViaRewind-Legacy-Support/issues/77
This commit is contained in:
FlorianMichael 2024-04-27 13:35:04 +02:00
parent 1c6be03d58
commit e580177856
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
1 changed files with 2 additions and 2 deletions

View File

@ -87,9 +87,9 @@ public class NMSUtil {
}
public static void sendPacket(final Player player, final Object packet) {
Object nmsPlayer = null;
Object nmsPlayer;
try {
player.getClass().getMethod("getHandle").invoke(player);
nmsPlayer = player.getClass().getMethod("getHandle").invoke(player);
} catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
BukkitPlugin.getInstance().getLogger().log(Level.SEVERE, "Failed to get EntityPlayer from player", e);
return;