From 14e196e95267d15e21ec28b6928a1dc713cc7ba9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 12 Jan 2013 11:18:35 +1100 Subject: [PATCH] Expand server ping method. --- .../main/java/net/md_5/bungee/api/Server.java | 4 +--- .../java/net/md_5/bungee/api/ServerPing.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 api/src/main/java/net/md_5/bungee/api/ServerPing.java diff --git a/api/src/main/java/net/md_5/bungee/api/Server.java b/api/src/main/java/net/md_5/bungee/api/Server.java index 83f2fee2..12476d0d 100644 --- a/api/src/main/java/net/md_5/bungee/api/Server.java +++ b/api/src/main/java/net/md_5/bungee/api/Server.java @@ -24,9 +24,7 @@ public abstract class Server implements Connection /** * Asynchronously gets the current player count on this server. * - * TODO: Return all info available via the standard query protocol - * * @param callback the callback to call when the count has been retrieved. */ - public abstract void getPlayerCount(Callback callback); + public abstract void getPlayerCount(Callback callback); } diff --git a/api/src/main/java/net/md_5/bungee/api/ServerPing.java b/api/src/main/java/net/md_5/bungee/api/ServerPing.java new file mode 100644 index 00000000..a12498a1 --- /dev/null +++ b/api/src/main/java/net/md_5/bungee/api/ServerPing.java @@ -0,0 +1,18 @@ +package net.md_5.bungee.api; + +import lombok.Data; + +/** + * Represents the standard list data returned by opening a server in the + * Minecraft client server list, or hitting it with a packet 0xFE. + */ +@Data +public class ServerPing +{ + + private final byte protocolVersion; + private final String gameVersion; + private final String motd; + private final String currentPlayers; + private final String maxPlayers; +}