From 2e04640638fe8fd24dabf8f1df295bc42a997645 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 24 Jan 2013 14:55:21 +1100 Subject: [PATCH] Add getters for game / protocol version. --- .../main/java/net/md_5/bungee/api/ProxyServer.java | 14 ++++++++++++++ .../src/main/java/net/md_5/bungee/BungeeCord.java | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyServer.java b/api/src/main/java/net/md_5/bungee/api/ProxyServer.java index 6530ba43..b42fb4a4 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyServer.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyServer.java @@ -182,4 +182,18 @@ public abstract class ProxyServer * @return registered plugin channels */ public abstract Collection getChannels(); + + /** + * Get the Minecraft version supported by this proxy. + * + * @return the supported Minecraft version + */ + public abstract String getGameVersion(); + + /** + * Get the Minecraft protocol version supported by this proxy. + * + * @return the Minecraft protocol version + */ + public abstract byte getProtocolVersion(); } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index 8966a9fd..4ec7b3e8 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -327,4 +327,16 @@ public class BungeeCord extends ProxyServer byte[] payload = sb.substring(0, sb.length() - 1).getBytes(); return new PacketFAPluginMessage("REGISTER", payload); } + + @Override + public byte getProtocolVersion() + { + return PROTOCOL_VERSION; + } + + @Override + public String getGameVersion() + { + return GAME_VERSION; + } }