Fix issue #4
This commit is contained in:
parent
8a3a7e2223
commit
f60e280bad
1 changed files with 6 additions and 0 deletions
|
|
@ -45,6 +45,12 @@ public class Ban implements CommandExecutor {
|
|||
if(args.length>=2) scope=args[1];
|
||||
if(args.length>=3) {
|
||||
duration=args[2];
|
||||
String regex = "^\\d+:(s|m|h|d)$";
|
||||
String regexOnlyNum = "^\\d+$";
|
||||
if(!(duration.matches(regex) || duration.matches(regexOnlyNum))) {
|
||||
p.sendMessage(TextUtils.colorString(plugin.translations.getString("command.ban.durationFormatError")));
|
||||
return false;
|
||||
}
|
||||
char type = plugin.config.getString("defaultDurationType").charAt(0);
|
||||
Integer time=0;
|
||||
boolean chk = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue