add method to get player ping

This commit is contained in:
Leymooo
2018-08-25 14:36:30 +03:00
parent ebb1810392
commit bf2dff7693
3 changed files with 29 additions and 4 deletions

View File

@@ -33,6 +33,12 @@ public interface Player extends CommandSource, InboundConnection, ChannelMessage
*/
Optional<ServerConnection> getCurrentServer();
/**
* Returns the current player's ping
* @return the player's ping or -1 if ping information is currently unknown
*/
long getPing();
/**
* Sends a chat message to the player's client.
* @param component the chat message to send