mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-24 02:08:48 +00:00
feat: 修复命令参数长度检测
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
5d04234863
commit
417a189f9b
@ -107,7 +107,7 @@ public class CommandInfo {
|
||||
if (method == null) {
|
||||
return false;
|
||||
}
|
||||
check(cmdArgs);
|
||||
if (check(cmdArgs)) {
|
||||
final Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -125,6 +125,8 @@ public class CommandInfo {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 命令注解
|
||||
@ -185,15 +187,19 @@ public class CommandInfo {
|
||||
Log.toSender(sender, cmdErr);
|
||||
Log.toSender(sender, String.format(cmdUse, cmdArgs.getAlias(), getName(), help.possibleArguments()));
|
||||
Log.toSender(sender, String.format(cmdDes, help.value()));
|
||||
return false;
|
||||
}
|
||||
if (sender instanceof Player && command.onlyConsole()) {
|
||||
Log.toSender(sender, onlyConsole);
|
||||
return false;
|
||||
} else if (command.onlyPlayer()) {
|
||||
Log.toSender(sender, onlyPlayer);
|
||||
return false;
|
||||
}
|
||||
final String perm = command.permission();
|
||||
if (perm != null && !sender.hasPermission(perm)) {
|
||||
Log.toSender(sender, String.format(losePerm, perm));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user