fix: sponge command dispatch error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-09-24 10:51:31 +08:00
parent 0667201605
commit 7962aa5da0

View File

@ -35,10 +35,10 @@ export class SpongeServer extends server.ReflectServer {
if (typeof sender === 'string') {
sender = this.getPlayer(sender)
}
return Sponge.getCommandManager().process(sender, command).getQueryResult().get() != 0
return Sponge.getCommandManager().process(sender, command).getSuccessCount().get() != 0
}
dispatchConsoleCommand(command: string): boolean {
return Sponge.getCommandManager().process(Sponge.getServer().getConsole(), command).getQueryResult().get() != 0
return Sponge.getCommandManager().process(Sponge.getServer().getConsole(), command).getSuccessCount().get() != 0
}
getPluginsFolder(): string {
return this.pluginsFolder
@ -55,10 +55,4 @@ export class SpongeServer extends server.ReflectServer {
getRootLogger() {
return this.rootLogger
}
sendJson(sender: string | any, json: string): void {
if (typeof sender === "string") {
sender = this.getPlayer(sender)
}
sender.sendMessage(TextSerializers.JSON.deserialize(json))
}
}