If they provide an incorrect format in time, don't override it.
This commit is contained in:
parent
978bd044fe
commit
a27596bcfb
@ -74,15 +74,15 @@ public class JailCommand implements Command {
|
||||
//Trying out the time.
|
||||
Long time = 10L;
|
||||
try {
|
||||
if(params.time().isEmpty()) {
|
||||
time = Util.getTime(jm.getPlugin().getConfig().getString(Settings.JAILDEFAULTTIME.getPath(), "30m"));
|
||||
}else {
|
||||
time = Util.getTime(params.time());
|
||||
}
|
||||
}catch(Exception e) {
|
||||
try {
|
||||
time = Util.getTime(jm.getPlugin().getConfig().getString(Settings.JAILDEFAULTTIME.getPath(), "10m"));
|
||||
}catch(Exception e2) {
|
||||
sender.sendMessage(ChatColor.RED + "Number format is incorrect.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Jail j = jm.getJail(params.jail());
|
||||
Prisoner pris = new Prisoner(params.player(), params.muted(), time);
|
||||
|
Loading…
Reference in New Issue
Block a user