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:
@@ -62,16 +62,21 @@ public class ViolationManager {
|
||||
double newVl = data.getViolationLevel(checkName);
|
||||
|
||||
if (plugin.isVerboseTarget(player.getUniqueId())) {
|
||||
Component verbose = miniMessage.deserialize(
|
||||
"<gray>[<white>VERBOSE<gray>] <yellow>" + player.getName()
|
||||
+ " <gray>» <white>" + checkName
|
||||
+ " <gray>+<green>" + String.format("%.1f", weight)
|
||||
+ " <gray>(VL: <white>" + String.format("%.1f", newVl) + "<gray>)"
|
||||
);
|
||||
for (Player staff : Bukkit.getOnlinePlayers()) {
|
||||
if (staff.hasPermission("xac.command.verbose") || staff.hasPermission("xac.admin")) {
|
||||
staff.sendMessage(verbose);
|
||||
long cooldownMs = plugin.getConfigManager().getInt("alerts.cooldown_ms", 5000);
|
||||
long now = System.currentTimeMillis();
|
||||
if ((now - data.getLastWarnTime(checkName)) >= cooldownMs) {
|
||||
Component verbose = miniMessage.deserialize(
|
||||
"<gray>[<white>VERBOSE<gray>] <yellow>" + player.getName()
|
||||
+ " <gray>» <white>" + checkName
|
||||
+ " <gray>+<green>" + String.format("%.1f", weight)
|
||||
+ " <gray>(VL: <white>" + String.format("%.1f", newVl) + "<gray>)"
|
||||
);
|
||||
for (Player staff : Bukkit.getOnlinePlayers()) {
|
||||
if (staff.hasPermission("xac.command.verbose") || staff.hasPermission("xac.admin")) {
|
||||
staff.sendMessage(verbose);
|
||||
}
|
||||
}
|
||||
data.setLastWarnTime(checkName, now);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user