mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-11 02:48:22 +01:00
[Fix] Fixed exception on CraftBukkit servers
Related to Ping gathering and Player.Spigot class
This commit is contained in:
parent
a131bb7dc8
commit
a531f23bef
@ -122,9 +122,9 @@ public class PingCountTimerBukkit extends AbsRunnable implements Listener {
|
|||||||
private static boolean isPingMethodAvailable() {
|
private static boolean isPingMethodAvailable() {
|
||||||
try {
|
try {
|
||||||
//Only available in Paper
|
//Only available in Paper
|
||||||
Player.Spigot.class.getDeclaredMethod("getPing");
|
Class.forName("org.bukkit.entity.Player.Spigot").getDeclaredMethod("getPing");
|
||||||
return true;
|
return true;
|
||||||
} catch (NoSuchMethodException noSuchMethodEx) {
|
} catch (ClassNotFoundException | NoSuchMethodException noSuchMethodEx) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user