Add disabled commands
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
@@ -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.
|
||||
*
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user