XeroAntiCheat v1.0.8 bug fixes
- SpiderCheck: fixed Location mutation bug - bodyBlock was reading y-1 (same as feetBlock) and headBlock was reading y instead of y+1. Now uses block coordinates directly. - ConfigManager: decay task no longer reads YamlConfiguration from background thread. decayRate is now volatile and refreshed on reload from main thread only. - JesusCheck, SpeedCheck, NoFallCheck: loc.subtract() now uses .clone() to prevent silent Location mutation. - VelocityCheck: decrementVelocityCheckTicks() moved past the minExpected threshold check to avoid consuming a tick on packets that are immediately discarded.
This commit is contained in:
@@ -22,13 +22,17 @@ public class ViolationManager {
|
||||
private final Map<UUID, PlayerData> playerDataCache = new ConcurrentHashMap<>();
|
||||
private final MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
|
||||
private double decayRate;
|
||||
private volatile double decayRate;
|
||||
|
||||
public ViolationManager(XeroAntiCheat plugin) {
|
||||
this.plugin = plugin;
|
||||
this.decayRate = plugin.getConfigManager().getDouble("violation.decay_rate", 0.5);
|
||||
}
|
||||
|
||||
public void setDecayRate(double rate) {
|
||||
this.decayRate = rate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or create player data for a player
|
||||
*/
|
||||
@@ -89,8 +93,6 @@ public class ViolationManager {
|
||||
* Decay all violation levels for all players
|
||||
*/
|
||||
public void decayAll() {
|
||||
decayRate = plugin.getConfigManager().getDouble("violation.decay_rate", 0.5);
|
||||
|
||||
for (PlayerData data : playerDataCache.values()) {
|
||||
for (String checkName : data.getViolationLevels().keySet()) {
|
||||
data.decayViolation(checkName, decayRate);
|
||||
|
||||
Reference in New Issue
Block a user