mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-03 01:19:58 +01:00
Tidy up PVP attack delay.
This commit is contained in:
parent
dc36a50d85
commit
7f5f6b6ac9
@ -33,8 +33,8 @@ public class EssentialsEntityListener implements Listener
|
||||
final User defender = ess.getUser(eDefend);
|
||||
final User attacker = ess.getUser(eAttack);
|
||||
|
||||
if (!attacker.isAuthorized("essentials.pvpdelay.exempt") &&
|
||||
System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay()))
|
||||
if (ess.getSettings().getLoginAttackDelay() > 0 && !attacker.isAuthorized("essentials.pvpdelay.exempt")
|
||||
&& (System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay())))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -388,6 +388,7 @@ public class Settings implements ISettings
|
||||
cancelAfkOnMove = _cancelAfkOnMove();
|
||||
getFreezeAfkPlayers = _getFreezeAfkPlayers();
|
||||
itemSpawnBl = _getItemSpawnBlacklist();
|
||||
loginAttackDelay = _loginAttackDelay();
|
||||
kits = _getKits();
|
||||
chatFormats.clear();
|
||||
}
|
||||
@ -805,6 +806,8 @@ public class Settings implements ISettings
|
||||
return teleportInvulnerability;
|
||||
}
|
||||
|
||||
private long loginAttackDelay;
|
||||
|
||||
private long _loginAttackDelay()
|
||||
{
|
||||
return config.getLong("login-attack-delay", 0) * 1000;
|
||||
@ -813,7 +816,7 @@ public class Settings implements ISettings
|
||||
@Override
|
||||
public long getLoginAttackDelay()
|
||||
{
|
||||
return _loginAttackDelay();
|
||||
return loginAttackDelay;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user