mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Fixed WaterWalk, removed useless freezing check
This commit is contained in:
1 parent
8317465a14
commit
4a596bb158
3 files changed
+3
-21
No files matched your search
@@ -166,15 +166,6 @@ public class Backend {
|
||||
lastFallPacket.remove(pN);
|
||||
}
|
||||
|
||||
public CheckResult checkFreeze(Player player, double from, double to) {
|
||||
// TODO: Fix! This is causing false-positives
|
||||
/*
|
||||
* if((from-to) > 0) { boolean flag = false; if(lastFallPacket.containsKey(player.getName()) && lastFallPacket.get(player.getName()) > 0) { flag = (System.currentTimeMillis()-lastFallPacket.get(player.getName())) > 1000; } lastFallPacket.put(player.getName(), System.currentTimeMillis());
|
||||
* return flag; } else { lastFallPacket.put(player.getName(), -1L); }
|
||||
*/
|
||||
return PASS;
|
||||
}
|
||||
|
||||
public CheckResult checkFastBow(Player player, float force) {
|
||||
// Ignore magic numbers here, they are minecrafty vanilla stuff.
|
||||
int ticks = (int) ((((System.currentTimeMillis() - bowWindUp.get(player.getName())) * 20) / 1000) + 3);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class WaterWalkCheck {
|
||||
isInWater.add(player.getName());
|
||||
return PASS;
|
||||
}
|
||||
} else if (block.getRelative(BlockFace.DOWN).isLiquid() && AntiCheat.getManager().getBackend().isAscending(player) && Utilities.cantStandAt(block) && Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) {
|
||||
} else if (block.getRelative(BlockFace.DOWN).isLiquid() && !AntiCheat.getManager().getBackend().isAscending(player) && Utilities.cantStandAt(block) && Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) {
|
||||
if (waterAscensionViolation.containsKey(player.getName())) {
|
||||
int v = waterAscensionViolation.get(player.getName());
|
||||
if (v >= AntiCheat.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {
|
||||
|
||||
@@ -320,16 +320,7 @@ public class PlayerListener extends EventListener {
|
||||
|
||||
final User user = getUserManager().getUser(player.getName());
|
||||
user.setTo(to.getX(), to.getY(), to.getZ());
|
||||
|
||||
if (getCheckManager().willCheckQuick(player, CheckType.SPEED)) {
|
||||
CheckResult result = getBackend().checkFreeze(player, from.getY(), to.getY());
|
||||
if (result.failed()) {
|
||||
log(result.getMessage(), player, CheckType.SPEED);
|
||||
if (!silentMode()) {
|
||||
player.kickPlayer("Freezing client");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getCheckManager().willCheckQuick(player, CheckType.SPRINT)) {
|
||||
CheckResult result = getBackend().checkSprintStill(player, from, to);
|
||||
if (result.failed()) {
|
||||
@@ -422,7 +413,7 @@ public class PlayerListener extends EventListener {
|
||||
CheckResult result = WaterWalkCheck.runCheck(player, x, y, z);
|
||||
if (result.failed()) {
|
||||
if (!silentMode()) {
|
||||
player.teleport(user.getGoodLocation(player.getLocation().add(0, -1, 0)));
|
||||
player.teleport(user.getGoodLocation(player.getLocation().add(0, -1.5, 0)));
|
||||
}
|
||||
log(result.getMessage(), player, CheckType.WATER_WALK);
|
||||
changed = true;
|
||||
|
||||
Reference in new issue
Block a user