From 863dc35e568e8c62adfadc95644eafa9790d0f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=8F=E9=BB=91?= Date: Thu, 10 May 2018 01:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF=E4=BB=A5=E5=8F=8A=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=A1=A5=E5=85=A8=E5=A4=A7=E5=B0=8F=E5=86=99=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skymc/taboolib/commands/internal/BaseMainCommand.java | 2 +- .../taboolib/commands/taboolib/VariableGetCommand.java | 8 ++++---- .../taboolib/commands/taboolib/VariableSetCommand.java | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/me/skymc/taboolib/commands/internal/BaseMainCommand.java b/src/main/java/me/skymc/taboolib/commands/internal/BaseMainCommand.java index 0aa3af3..d9c9eb8 100644 --- a/src/main/java/me/skymc/taboolib/commands/internal/BaseMainCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/internal/BaseMainCommand.java @@ -119,7 +119,7 @@ public abstract class BaseMainCommand implements IMainCommand, CommandExecutor, @Override public List 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 diff --git a/src/main/java/me/skymc/taboolib/commands/taboolib/VariableGetCommand.java b/src/main/java/me/skymc/taboolib/commands/taboolib/VariableGetCommand.java index ec338b6..7688b43 100644 --- a/src/main/java/me/skymc/taboolib/commands/taboolib/VariableGetCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/taboolib/VariableGetCommand.java @@ -14,12 +14,12 @@ public class VariableGetCommand extends SubCommand { super(sender, args); if (args.length < 3) { - TLocale.sendTo(sender, "COAMMNDS.PARAMETER.INSUFFICIENT"); + TLocale.sendTo(sender, "COMMANDS.PARAMETER.INSUFFICIENT"); return; } 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; } @@ -32,7 +32,7 @@ public class VariableGetCommand extends SubCommand { value = GlobalDataManager.getVariableAsynchronous(args[2], null); } - TLocale.sendTo(sender, "COAMMNDS.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-SUCCESS", String.valueOf(System.currentTimeMillis() - time)); + TLocale.sendTo(sender, "COMMANDS.TABOOLIB.VARIABLE.READ-RESULT", value == null ? "null" : value); } } diff --git a/src/main/java/me/skymc/taboolib/commands/taboolib/VariableSetCommand.java b/src/main/java/me/skymc/taboolib/commands/taboolib/VariableSetCommand.java index 1e7c257..d1f9634 100644 --- a/src/main/java/me/skymc/taboolib/commands/taboolib/VariableSetCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/taboolib/VariableSetCommand.java @@ -11,12 +11,12 @@ public class VariableSetCommand extends SubCommand { super(sender, args); if (args.length < 4) { - TLocale.sendTo(sender, "COAMMNDS.PARAMETER.INSUFFICIENT"); + TLocale.sendTo(sender, "COMMANDS.PARAMETER.INSUFFICIENT"); return; } 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; } @@ -29,7 +29,7 @@ public class VariableSetCommand extends SubCommand { 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); } }