Bleeding fix for #81, added #76 and started working on OF zoom support

This commit is contained in:
Rammelkast committed 2020-05-04 15:40:14 +02:00
1 parent cd3184f17b
commit 8cf2702708
5 files changed
+69 -4

No files matched your search

@@ -84,7 +84,8 @@ public class GlideCheck {
&& Utilities.isNotNearSlime(distance.getTo().getBlock()) && fallDistance < 1.5
&& !Utilities.isNearClimbable(player)
&& !player.isSneaking()
&& !AntiCheatReloaded.getManager().getBackend().isEating(player)) {
&& !AntiCheatReloaded.getManager().getBackend().isEating(player)
&& !Utilities.isInWater(player)) {
// TODO that fallDistance check is a horrible way to prevent a certain false
// positive
// Needs to be fixed since this only works for slight above ground movements
@@ -31,6 +31,7 @@ import com.rammelkast.anticheatreloaded.check.Backend;
import com.rammelkast.anticheatreloaded.check.CheckResult;
import com.rammelkast.anticheatreloaded.check.CheckType;
import com.rammelkast.anticheatreloaded.event.EventListener;
import com.rammelkast.anticheatreloaded.util.User;
public class BadPacketsCheck {
@@ -41,6 +42,7 @@ public class BadPacketsCheck {
return;
}
User user = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId());
PacketContainer packet = event.getPacket();
float pitch = packet.getFloat().read(1);
// Check for derp
@@ -50,7 +52,7 @@ public class BadPacketsCheck {
}
// TODO more precise checking for this
if (AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId()).isLagging()) {
if (user.isLagging()) {
return;
}
@@ -73,6 +75,8 @@ public class BadPacketsCheck {
//flag(player, event, "sent the same packet twice");
return;
}
user.checkForOptifine(yaw, pitch);
}
private static void flag(Player player, PacketEvent event, String message) {