feat: add remove plugin on disable

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-09-22 18:00:18 +08:00
parent 1ea93dfb9f
commit b3c2def36d
5 changed files with 53 additions and 16 deletions

View File

@ -27,6 +27,12 @@ export class BukkitCommand extends command.Command {
this.commandMap.register(plugin.description.name, cmd);
return cmd;
}
remove(plugin: any, command: string) {
var cmd = this.commandMap.getCommand(command)
if (cmd && cmd instanceof PluginCommand) {
cmd.unregister(this.commandMap);
}
}
onCommand(plugin: any, command: any, executor: Function) {
// 必须指定需要实现的接口类型 否则MOD服会报错
command.setExecutor(new CommandExecutor({