feat: complate command event and task

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-09-21 15:04:47 +08:00
parent bf5628a646
commit c4c2c0ab0f
6 changed files with 166 additions and 5 deletions

View File

@ -11,7 +11,7 @@ export class SpongeConsole extends MiaoScriptConsole {
this.error('第一个参数未实现 org.spongepowered.api.command.CommandSource 无法发送消息!')
return
}
if (args[0].toString() === '[object Array]') {
if (Object.prototype.toString.call(args[0]) === '[object Array]') {
args[0].forEach(line => sender.sendMessage(Text.of(this.prefix + line)))
} else {
sender.sendMessage(Text.of(this.prefix + args.join(' ')));