Add disabled commands

This commit is contained in:
md_5
2013-07-09 14:55:27 +10:00
parent 9adcb05d45
commit 0189ad9c17
6 changed files with 38 additions and 1 deletions

View File

@@ -240,4 +240,11 @@ public abstract class ProxyServer
* @return a new {@link CustomTabList} instance
*/
public abstract CustomTabList customTabList(ProxiedPlayer player);
/**
* Gets the commands which are disabled and will not be run on this proxy.
*
* @return the set of disabled commands
*/
public abstract Collection<String> getDisabledCommands();
}

View File

@@ -43,6 +43,15 @@ public interface ConfigurationAdapter
*/
public boolean getBoolean(String path, boolean def);
/**
* Get a list from the specified path.
*
* @param path the path to retrieve the list form.
* @param def the default value
* @return the retrieved list
*/
public Collection<?> getList(String path, Collection<?> def);
/**
* Get the configuration all servers which may be accessible via the proxy.
*

View File

@@ -86,7 +86,12 @@ public class PluginManager
public boolean dispatchCommand(CommandSender sender, String commandLine)
{
String[] split = argsSplit.split( commandLine );
Command command = commandMap.get( split[0].toLowerCase() );
String commandName = split[0].toLowerCase();
if ( proxy.getDisabledCommands().contains( commandName ) )
{
return false;
}
Command command = commandMap.get( commandName );
if ( command == null )
{
return false;