fix: 修复Sponge命令参数存在空字符串的问题
This commit is contained in:
parent
c095593c41
commit
f94653249d
@ -31,11 +31,11 @@ var SimpleCommandCallable = function (command) {
|
|||||||
this.callable = new CommandCallable({
|
this.callable = new CommandCallable({
|
||||||
//CommandResult process(CommandSource source, String arguments) throws CommandException;
|
//CommandResult process(CommandSource source, String arguments) throws CommandException;
|
||||||
process: function (src, args) {
|
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<String> getSuggestions(CommandSource source, String arguments, @Nullable Location<World> targetPosition) throws CommandException;
|
//List<String> getSuggestions(CommandSource source, String arguments, @Nullable Location<World> targetPosition) throws CommandException;
|
||||||
getSuggestions: function (src, args, target) {
|
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);
|
//boolean testPermission(CommandSource source);
|
||||||
testPermission: function () {
|
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 = {
|
exports = module.exports = {
|
||||||
enable: enable,
|
enable: enable,
|
||||||
on: on,
|
on: on,
|
||||||
|
Loading…
Reference in New Issue
Block a user