[Fix] Fixed exception on CraftBukkit servers

Related to Ping gathering and Player.Spigot class
This commit is contained in:
Rsl1122 2018-10-27 15:57:11 +03:00
parent a131bb7dc8
commit a531f23bef
1 changed files with 2 additions and 2 deletions

View File

@ -122,9 +122,9 @@ public class PingCountTimerBukkit extends AbsRunnable implements Listener {
private static boolean isPingMethodAvailable() {
try {
//Only available in Paper
Player.Spigot.class.getDeclaredMethod("getPing");
Class.forName("org.bukkit.entity.Player.Spigot").getDeclaredMethod("getPing");
return true;
} catch (NoSuchMethodException noSuchMethodEx) {
} catch (ClassNotFoundException | NoSuchMethodException noSuchMethodEx) {
return false;
}
}