From 9c1884adafbc56755506060ed4e3a7ead39dc7c4 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sat, 5 Sep 2015 09:12:04 -0400 Subject: [PATCH] Allow commands to dynamically decide if they should be handled or passed upstream --- .../md_5/bungee/api/plugin/CommandBypassException.java | 8 ++++++++ .../java/net/md_5/bungee/api/plugin/PluginManager.java | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 api/src/main/java/net/md_5/bungee/api/plugin/CommandBypassException.java diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/CommandBypassException.java b/api/src/main/java/net/md_5/bungee/api/plugin/CommandBypassException.java new file mode 100644 index 0000000000..0c3419c825 --- /dev/null +++ b/api/src/main/java/net/md_5/bungee/api/plugin/CommandBypassException.java @@ -0,0 +1,8 @@ +package net.md_5.bungee.api.plugin; + +/** + * Thrown from inside a command to tell the proxy to pass the command upstream + */ +public class CommandBypassException extends RuntimeException { + +} diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index 91ab95adb2..5da8bf40e4 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -167,6 +167,8 @@ public boolean dispatchCommand(CommandSender sender, String commandLine, List