mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 08:35:44 +01:00
Fix max tempban length option.
This commit is contained in:
parent
8f00aa5542
commit
78666ade2b
@ -46,8 +46,8 @@ public class Commandtempban extends EssentialsCommand
|
||||
final String time = getFinalArg(args, 1);
|
||||
final long banTimestamp = Util.parseDateDiff(time, true);
|
||||
|
||||
final long max = ess.getSettings().getMaxTempban();
|
||||
if(max != 0 && banTimestamp - GregorianCalendar.getInstance().getTimeInMillis() > max * 1000 && ess.getUser(sender).isAuthorized("essentials.tempban.unlimited"))
|
||||
final long maxBanLength = ess.getSettings().getMaxTempban() * 1000;
|
||||
if(maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && ess.getUser(sender).isAuthorized("essentials.tempban.unlimited"))
|
||||
{
|
||||
sender.sendMessage(_("oversizedTempban"));
|
||||
throw new NoChargeException();
|
||||
|
Loading…
Reference in New Issue
Block a user