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