From 2d3ea4d8893a50c1cded6440b3a11bf01ac056e7 Mon Sep 17 00:00:00 2001 From: Rammelkast Date: Wed, 1 Jun 2016 17:29:13 +0200 Subject: [PATCH] Velocity fixes --- .../anticheat/check/combat/VelocityCheck.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/gravitydevelopment/anticheat/check/combat/VelocityCheck.java b/src/main/java/net/gravitydevelopment/anticheat/check/combat/VelocityCheck.java index 7c24646..0766099 100644 --- a/src/main/java/net/gravitydevelopment/anticheat/check/combat/VelocityCheck.java +++ b/src/main/java/net/gravitydevelopment/anticheat/check/combat/VelocityCheck.java @@ -29,14 +29,16 @@ public class VelocityCheck { new BukkitRunnable() { @Override public void run() { + if (!p.isOnline()) + return; if (then.distance(p.getLocation()) < 0.125) { if (!VL_COUNT.containsKey(p.getUniqueId())) VL_COUNT.put(p.getUniqueId(), 1); else { VL_COUNT.put(p.getUniqueId(), VL_COUNT.get(p.getUniqueId()) + 1); if (VL_COUNT.get(p.getUniqueId()) > AntiCheat.getManager().getBackend().getMagic().VELOCITY_AMT()) { - VL_COUNT.remove(p.getUniqueId()); EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed Velocity, had zero/low velocity " + VL_COUNT.get(p.getUniqueId()) + " times (max=" + AntiCheat.getManager().getBackend().getMagic().VELOCITY_AMT() + ")").getMessage(), p, CheckType.VELOCITY); + VL_COUNT.remove(p.getUniqueId()); } } }else {