Skip to content
This repository was archived by the owner on Aug 31, 2019. It is now read-only.

Commit 9c1884a

Browse files
committed
Allow commands to dynamically decide if they should be handled or passed upstream
1 parent d2b8c6f commit 9c1884a

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package net.md_5.bungee.api.plugin;
2+
3+
/**
4+
* Thrown from inside a command to tell the proxy to pass the command upstream
5+
*/
6+
public class CommandBypassException extends RuntimeException {
7+
8+
}

api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ public boolean dispatchCommand(CommandSender sender, String commandLine, List<St
167167
tabResults.add( s );
168168
}
169169
}
170+
} catch ( CommandBypassException ex ) {
171+
return false;
170172
} catch ( Exception ex )
171173
{
172174
sender.sendMessage( ChatColor.RED + "An internal error occurred whilst executing this command, please check the console log for details." );

0 commit comments

Comments
 (0)