版本更新至 4.08
调整:优化 /tplugin 各项命令,更多提示。 修复:修复 BaseSubCommand 中仅允许控制台类型无效的错误。 新增:/tlib updatePlugin 命令用于下载更新。 新增:自动下载最新版(默认关闭)。
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user