clearPlugins() and clearCommands() for PluginManager and CommandMap respectively

This commit is contained in:
Dinnerbone
2011-01-28 14:18:24 +00:00
parent 7989fe0a20
commit d67110aecf
6 changed files with 40 additions and 0 deletions

View File

@@ -26,4 +26,8 @@ public interface CommandMap {
*/
public boolean dispatch(Player sender, String cmdLine);
/**
* Clears all registered commands.
*/
public void clearCommands();
}

View File

@@ -86,6 +86,12 @@ public final class SimpleCommandMap implements CommandMap {
return isRegisteredCommand;
}
public void clearCommands() {
synchronized (this) {
knownCommands.clear();
}
}
private static class VersionCommand extends Command {
private final Server server;