版本更新至 4.08

调整:优化 /tplugin 各项命令,更多提示。
修复:修复 BaseSubCommand 中仅允许控制台类型无效的错误。
新增:/tlib updatePlugin 命令用于下载更新。
新增:自动下载最新版(默认关闭)。
This commit is contained in:
坏黑
2018-06-03 21:10:00 +08:00
parent efeb088a70
commit 2c61f793f7
13 changed files with 262 additions and 84 deletions

View File

@@ -109,7 +109,7 @@ public abstract class BaseMainCommand implements IMainCommand, CommandExecutor,
continue;
}
if (!isConfirmType(sender, subCommand.getType())) {
TLocale.sendTo(sender, "COMMANDS.INTERNAL.ONLY-PLAYER", args[0], TLocale.asString("COMMANDS.INTERNAL.TYPE-" + subCommand.getType()));
TLocale.sendTo(sender, "COMMANDS.INTERNAL.TYPE-ERROR", args[0], TLocale.asString("COMMANDS.INTERNAL.TYPE-" + subCommand.getType()));
return true;
}
String[] subCommandArgs = ArrayUtils.removeFirst(args);
@@ -166,7 +166,9 @@ public abstract class BaseMainCommand implements IMainCommand, CommandExecutor,
}
private boolean isConfirmType(CommandSender sender, CommandType commandType) {
return commandType == CommandType.ALL || (sender instanceof Player && commandType == CommandType.PLAYER);
return commandType == CommandType.ALL
|| (sender instanceof Player && commandType == CommandType.PLAYER)
|| (sender instanceof ConsoleCommandSender && commandType == CommandType.CONSOLE);
}
private void helpCommand(CommandSender sender, String label) {