修复部分提示错误以及命令补全大小写无法识别的问题
This commit is contained in:
parent
4cbe7ee9da
commit
863dc35e56
@ -119,7 +119,7 @@ public abstract class BaseMainCommand implements IMainCommand, CommandExecutor,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] args) {
|
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] args) {
|
||||||
return args.length == 1 ? subCommands.stream().filter(internalCommandExecutor -> internalCommandExecutor != null && (args[0].isEmpty() || internalCommandExecutor.getLabel().startsWith(args[0]))).map(ISubCommand::getLabel).collect(Collectors.toList()) : null;
|
return args.length == 1 ? subCommands.stream().filter(internalCommandExecutor -> internalCommandExecutor != null && (args[0].isEmpty() || internalCommandExecutor.getLabel().toLowerCase().startsWith(args[0].toLowerCase()))).map(ISubCommand::getLabel).collect(Collectors.toList()) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,12 +14,12 @@ public class VariableGetCommand extends SubCommand {
|
|||||||
super(sender, args);
|
super(sender, args);
|
||||||
|
|
||||||
if (args.length < 3) {
|
if (args.length < 3) {
|
||||||
TLocale.sendTo(sender, "COAMMNDS.PARAMETER.INSUFFICIENT");
|
TLocale.sendTo(sender, "COMMANDS.PARAMETER.INSUFFICIENT");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!("-a".equals(args[1]) || "-s".equals(args[1]))) {
|
if (!("-a".equals(args[1]) || "-s".equals(args[1]))) {
|
||||||
TLocale.sendTo(sender, "COAMMNDS.TABOOLIB.VARIABLE.READ-ERROR-TYPE");
|
TLocale.sendTo(sender, "COMMANDS.TABOOLIB.VARIABLE.READ-ERROR-TYPE");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class VariableGetCommand extends SubCommand {
|
|||||||
value = GlobalDataManager.getVariableAsynchronous(args[2], null);
|
value = GlobalDataManager.getVariableAsynchronous(args[2], null);
|
||||||
}
|
}
|
||||||
|
|
||||||
TLocale.sendTo(sender, "COAMMNDS.TABOOLIB.VARIABLE.READ-SUCCESS", String.valueOf(System.currentTimeMillis() - time));
|
TLocale.sendTo(sender, "COMMANDS.TABOOLIB.VARIABLE.READ-SUCCESS", String.valueOf(System.currentTimeMillis() - time));
|
||||||
TLocale.sendTo(sender, "COAMMNDS.TABOOLIB.VARIABLE.READ-RESULT", value == null ? "null" : value);
|
TLocale.sendTo(sender, "COMMANDS.TABOOLIB.VARIABLE.READ-RESULT", value == null ? "null" : value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,12 @@ public class VariableSetCommand extends SubCommand {
|
|||||||
super(sender, args);
|
super(sender, args);
|
||||||
|
|
||||||
if (args.length < 4) {
|
if (args.length < 4) {
|
||||||
TLocale.sendTo(sender, "COAMMNDS.PARAMETER.INSUFFICIENT");
|
TLocale.sendTo(sender, "COMMANDS.PARAMETER.INSUFFICIENT");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!("-a".equals(args[1]) || "-s".equals(args[1]))) {
|
if (!("-a".equals(args[1]) || "-s".equals(args[1]))) {
|
||||||
TLocale.sendTo(sender, "COAMMNDS.TABOOLIB.VARIABLE.WRITE-ERROR-TYPE");
|
TLocale.sendTo(sender, "COMMANDS.TABOOLIB.VARIABLE.WRITE-ERROR-TYPE");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ public class VariableSetCommand extends SubCommand {
|
|||||||
GlobalDataManager.setVariableAsynchronous(args[2], value);
|
GlobalDataManager.setVariableAsynchronous(args[2], value);
|
||||||
}
|
}
|
||||||
|
|
||||||
TLocale.sendTo(sender, "COAMMNDS.TABOOLIB.VARIABLE.WRITE-SUCCESS", String.valueOf(System.currentTimeMillis() - time));
|
TLocale.sendTo(sender, "COMMANDS.TABOOLIB.VARIABLE.WRITE-SUCCESS", String.valueOf(System.currentTimeMillis() - time));
|
||||||
setReturn(true);
|
setReturn(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user