This commit is contained in:
Tomasz Kuraczyk 2026-02-25 17:52:26 +01:00
parent 8a3a7e2223
commit f60e280bad

View file

@ -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;