XeroAntiCheat v1.0.9 bug fixes

- BUG-1: Added alerts.cooldown_ms (default 5s) to throttle warn() and
  sendAlert() in PunishmentManager, preventing chat spam during high-frequency
  flags. Verbose output in ViolationManager also respects the cooldown.
  Kick/ban punishments always fire immediately regardless of cooldown.
- BUG-2: Fixed FlyCheck false positive with Jump Boost I - condition was
  incorrectly flagging players with Jump Boost level 1. Now exempts all
  jump boost levels from the sustained-flight flag.
- BUG-3: Optimized SpiderCheck by caching player.getLocation() in a single
  variable instead of calling it 3 times.
This commit is contained in:
2026-03-15 03:51:27 -03:00
parent 38ab1abaf1
commit 8190b39160
9 changed files with 50 additions and 18 deletions

View File

@@ -76,7 +76,17 @@ public class PunishmentManager {
Check check = plugin.getCheckManager().getCheck(checkName);
String category = check != null ? check.getCategory() : "misc";
sendAlert(player, checkName, vl, category);
long cooldownMs = plugin.getConfigManager().getInt("alerts.cooldown_ms", 5000);
long now = System.currentTimeMillis();
long lastWarn = data.getLastWarnTime(checkName);
boolean cooledDown = (now - lastWarn) >= cooldownMs;
boolean isPunishment = vl >= kickVl;
if (cooledDown || isPunishment) {
sendAlert(player, checkName, vl, category);
data.setLastWarnTime(checkName, now);
}
if (vl >= permbanVl) {
punish(player, checkName, "PERMBAN", permbanVl);
@@ -84,7 +94,7 @@ public class PunishmentManager {
punish(player, checkName, "TEMPBAN", tempbanVl);
} else if (vl >= kickVl) {
punish(player, checkName, "KICK", kickVl);
} else if (vl >= warnVl) {
} else if (vl >= warnVl && cooledDown) {
warn(player, checkName);
}
}