Fix #167, vastly improved aimbot check (experimental)

This commit is contained in:
Rammelkast committed 2021-10-12 14:22:34 +02:00
1 parent e2d0fbda18
commit 78ae04a2a8
12 files changed
+110 -70

No files matched your search

@@ -78,18 +78,12 @@ public final class BadPacketsCheck {
maxDistance *= 1.5D;
}
final boolean hasNewLocation = packet.getBooleans().read(0);
if (distance > maxDistance) {
flag(player, event,
"moved too far between packets (distance="
+ new BigDecimal(distance).setScale(1, RoundingMode.HALF_UP) + ", max=" + maxDistance
+ ", at=" + movementManager.airTicks + ")");
return;
} else if (distance < 1E-10 && !hasNewLocation) {
// TODO this gives false positives when teleporting
// Only found this in 1.8.8 though
// flag(player, event, "sent the same packet twice");
return;
}
}