mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Fixed WaterWalk, removed useless freezing check
This commit is contained in:
1 parent
8317465a14
commit
4a596bb158
3 files changed
+2
-20
No files matched your search
@@ -166,15 +166,6 @@ public class Backend {
|
|||||||
lastFallPacket.remove(pN);
|
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) {
|
public CheckResult checkFastBow(Player player, float force) {
|
||||||
// Ignore magic numbers here, they are minecrafty vanilla stuff.
|
// Ignore magic numbers here, they are minecrafty vanilla stuff.
|
||||||
int ticks = (int) ((((System.currentTimeMillis() - bowWindUp.get(player.getName())) * 20) / 1000) + 3);
|
int ticks = (int) ((((System.currentTimeMillis() - bowWindUp.get(player.getName())) * 20) / 1000) + 3);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class WaterWalkCheck {
|
|||||||
isInWater.add(player.getName());
|
isInWater.add(player.getName());
|
||||||
return PASS;
|
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())) {
|
if (waterAscensionViolation.containsKey(player.getName())) {
|
||||||
int v = waterAscensionViolation.get(player.getName());
|
int v = waterAscensionViolation.get(player.getName());
|
||||||
if (v >= AntiCheat.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {
|
if (v >= AntiCheat.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {
|
||||||
|
|||||||
@@ -321,15 +321,6 @@ public class PlayerListener extends EventListener {
|
|||||||
final User user = getUserManager().getUser(player.getName());
|
final User user = getUserManager().getUser(player.getName());
|
||||||
user.setTo(to.getX(), to.getY(), to.getZ());
|
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)) {
|
if (getCheckManager().willCheckQuick(player, CheckType.SPRINT)) {
|
||||||
CheckResult result = getBackend().checkSprintStill(player, from, to);
|
CheckResult result = getBackend().checkSprintStill(player, from, to);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
@@ -422,7 +413,7 @@ public class PlayerListener extends EventListener {
|
|||||||
CheckResult result = WaterWalkCheck.runCheck(player, x, y, z);
|
CheckResult result = WaterWalkCheck.runCheck(player, x, y, z);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
if (!silentMode()) {
|
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);
|
log(result.getMessage(), player, CheckType.WATER_WALK);
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|||||||
Reference in new issue
Block a user