From 7962aa5da092418a5aeb51652bd5e5f082211177 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Thu, 24 Sep 2020 10:51:31 +0800 Subject: [PATCH] fix: sponge command dispatch error Signed-off-by: MiaoWoo --- packages/sponge/src/server.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/sponge/src/server.ts b/packages/sponge/src/server.ts index 6b9bd5f3..d6622f55 100644 --- a/packages/sponge/src/server.ts +++ b/packages/sponge/src/server.ts @@ -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)) - } }