From 3dac86a94c0b7bec0181e7ac94973f9e929badea Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 12 Mar 2013 12:01:47 +1100 Subject: [PATCH] Add getConsole() to the API --- api/src/main/java/net/md_5/bungee/api/ProxyServer.java | 9 +++++++++ proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 7 +++++++ 2 files changed, 16 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 9cdf2324..a9d05477 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 @@ -211,4 +211,13 @@ public abstract class ProxyServer * @return the constructed instance */ public abstract ServerInfo constructServerInfo(String name, InetSocketAddress address); + + /** + * Returns the console overlord for this proxy. Being the console, this + * command server cannot have permissions or groups, and will be able to + * execute anything. + * + * @return the console command sender of this proxy + */ + public abstract CommandSender getConsole(); } 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 cdf0ac67..6b50c506 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -28,6 +28,7 @@ import lombok.Getter; import lombok.Setter; import lombok.Synchronized; import static net.md_5.bungee.Logger.$; +import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ReconnectHandler; import net.md_5.bungee.api.TabListHandler; @@ -371,4 +372,10 @@ public class BungeeCord extends ProxyServer { return new BungeeServerInfo( name, address ); } + + @Override + public CommandSender getConsole() + { + return ConsoleCommandSender.getInstance(); + } }