From f94653249d7bae783d25dff0645421a8556be488 Mon Sep 17 00:00:00 2001 From: coding Date: Thu, 17 May 2018 12:35:38 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DSponge=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=8F=82=E6=95=B0=E5=AD=98=E5=9C=A8=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/internal/sponge/command.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/resources/internal/sponge/command.js b/src/main/resources/internal/sponge/command.js index d53705c..a5820fd 100644 --- a/src/main/resources/internal/sponge/command.js +++ b/src/main/resources/internal/sponge/command.js @@ -31,11 +31,11 @@ var SimpleCommandCallable = function (command) { this.callable = new CommandCallable({ //CommandResult process(CommandSource source, String arguments) throws CommandException; process: function (src, args) { - return that.cmd(src, that.name, args.length === 0 ? [] : args.split(" ")) ? CommandResult.success() : CommandResult.empty(); + return that.cmd(src, that.name, args.length === 0 ? [] : args.split(" ").filter(function (e) { return e; })) ? CommandResult.success() : CommandResult.empty(); }, //List getSuggestions(CommandSource source, String arguments, @Nullable Location targetPosition) throws CommandException; getSuggestions: function (src, args, target) { - return that.tab(src, that.name, args.length === 0 ? [] : args.split(" ")); + return that.tab(src, that.name, args.length === 0 ? [] : args.split(" ").filter(function (e) { return e; })); }, //boolean testPermission(CommandSource source); testPermission: function () { @@ -121,12 +121,6 @@ function on(jsp, name, exec) { } } -Sponge.getCommandManager().getOwnedBy(plugin).forEach(function (commandMapping) { - if (!commandMapping.getAllAliases().contains("ms")) { - Sponge.getCommandManager().removeMapping(commandMapping); - } -}); - exports = module.exports = { enable: enable, on: on,