mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 22:15:28 +00:00
Hopefully fix PlayerMoveEvent NPE
This commit is contained in:
1 parent
11d9afaec8
commit
2b55df7506
1 file changed
+3
-2
@@ -460,7 +460,8 @@ public class Backend {
|
|||||||
yAxisLastViolation.put(name, 0L);
|
yAxisLastViolation.put(name, 0L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((y1 - lastYcoord.get(name)) > magic.Y_MAXDIFF && (System.currentTimeMillis() - lastYtime.get(name)) < magic.Y_TIME) {
|
long i = System.currentTimeMillis() - lastYtime.get(name);
|
||||||
|
if ((y1 - lastYcoord.get(name)) > magic.Y_MAXDIFF && i < magic.Y_TIME) {
|
||||||
Location g = player.getLocation();
|
Location g = player.getLocation();
|
||||||
yAxisViolations.put(name, yAxisViolations.get(name) + 1);
|
yAxisViolations.put(name, yAxisViolations.get(name) + 1);
|
||||||
yAxisLastViolation.put(name, System.currentTimeMillis());
|
yAxisLastViolation.put(name, System.currentTimeMillis());
|
||||||
@@ -470,7 +471,7 @@ public class Backend {
|
|||||||
player.teleport(g);
|
player.teleport(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CheckResult(Result.FAILED, player.getName()+" tried to fly on y-axis in "+(System.currentTimeMillis() - lastYtime.get(name))+" ms (min ="+magic.Y_TIME+")");
|
return new CheckResult(Result.FAILED, player.getName()+" tried to fly on y-axis in "+i+" ms (min ="+magic.Y_TIME+")");
|
||||||
} else {
|
} else {
|
||||||
if ((y1 - lastYcoord.get(name)) > magic.Y_MAXDIFF + 1 || (System.currentTimeMillis() - lastYtime.get(name)) > magic.Y_TIME) {
|
if ((y1 - lastYcoord.get(name)) > magic.Y_MAXDIFF + 1 || (System.currentTimeMillis() - lastYtime.get(name)) > magic.Y_TIME) {
|
||||||
lastYtime.put(name, System.currentTimeMillis());
|
lastYtime.put(name, System.currentTimeMillis());
|
||||||
|
|||||||
Reference in new issue
Block a user