Created
September 15, 2016 09:08
-
-
Save rz7d/6be7b3016fc1be67479f5c9034909617 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int getPing(Player player) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchFieldException { | |
Method method = player.getClass().getDeclaredMethod("getHandle"); | |
method.setAccessible(true); | |
Object handle = method.invoke(player); | |
return ((Integer) handle.getClass().getField("ping").get(handle)).intValue(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment