mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Prepare for release
This commit is contained in:
1 parent
7e37e8558b
commit
3af7bde9db
8 files changed
+52
-48
No files matched your search
@@ -69,13 +69,14 @@ public class BlinkCheck {
|
||||
&& !AntiCheatReloaded.getManager().getCheckManager().isOpExempt(p)
|
||||
&& !AntiCheatReloaded.getManager().getCheckManager().isExempt(p, CheckType.BLINK)) {
|
||||
int ping = VersionUtil.getPlayerPing(p);
|
||||
int blinkMagic = AntiCheatReloaded.getManager().getBackend()
|
||||
.getMagic().BLINK_PACKET();
|
||||
int averagePing = AntiCheatReloaded.getManager().getBackend()
|
||||
.getMagic().BLINK_AVERAGE_PING();
|
||||
int blinkMagic = AntiCheatReloaded.getManager().getBackend().getMagic().BLINK_PACKET();
|
||||
int averagePing = AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.BLINK_AVERAGE_PING();
|
||||
float pingLeniency = (float) ((ping / averagePing));
|
||||
if (pingLeniency < 1) pingLeniency = 1;
|
||||
if (pingLeniency > 2.5F) pingLeniency = 2.5F;
|
||||
if (pingLeniency < 1)
|
||||
pingLeniency = 1;
|
||||
if (pingLeniency > 2.5F)
|
||||
pingLeniency = 2.5F;
|
||||
blinkMagic = Math.round(pingLeniency * blinkMagic);
|
||||
final float finalPingLeniency = pingLeniency;
|
||||
try {
|
||||
@@ -85,11 +86,12 @@ public class BlinkCheck {
|
||||
AntiCheatReloaded.sendToMainThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
EventListener.log(
|
||||
new CheckResult(CheckResult.Result.FAILED, "sent " + packets
|
||||
+ " packets in one second (max=" + AntiCheatReloaded.getManager()
|
||||
.getBackend().getMagic().BLINK_PACKET()
|
||||
+ ", leniency=" + finalPingLeniency + ", ping=" + ping + ")").getMessage(),
|
||||
EventListener.log(new CheckResult(CheckResult.Result.FAILED,
|
||||
"sent " + packets + " packets in one second (max="
|
||||
+ AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.BLINK_PACKET()
|
||||
+ ", leniency=" + finalPingLeniency + ", ping=" + ping
|
||||
+ ")").getMessage(),
|
||||
p, CheckType.BLINK);
|
||||
e.setCancelled(true);
|
||||
e.getPlayer().teleport(cur);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ElytraCheck {
|
||||
JUMP_Y_VALUE.remove(uuid);
|
||||
return PASS;
|
||||
}
|
||||
|
||||
|
||||
double changeY = distance.toY() - distance.fromY();
|
||||
boolean upwardMovement = changeY > 0;
|
||||
if (player.getInventory().getItemInMainHand().getType() == Material.TRIDENT) {
|
||||
@@ -57,28 +57,26 @@ public class ElytraCheck {
|
||||
return PASS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (changeY == 0.0D) {
|
||||
// Seen no false positives here yet
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"had no Y-axis dropoff when gliding with Elytra");
|
||||
return new CheckResult(CheckResult.Result.FAILED, "had no Y-axis dropoff when gliding with Elytra");
|
||||
}
|
||||
|
||||
|
||||
if (!JUMP_Y_VALUE.containsKey(uuid)) {
|
||||
JUMP_Y_VALUE.put(uuid, distance.toY());
|
||||
return PASS;
|
||||
}
|
||||
double lastY = JUMP_Y_VALUE.get(uuid);
|
||||
if (lastY < distance.toY()) {
|
||||
double diff = distance.toY() - lastY;
|
||||
double diff = distance.toY() - lastY;
|
||||
if (diff > 0.7675) {
|
||||
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||
Location to = player.getLocation();
|
||||
to.setY(to.getY() - diff);
|
||||
player.teleport(to);
|
||||
}
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"tried to glide above jump level");
|
||||
return new CheckResult(CheckResult.Result.FAILED, "tried to glide above jump level");
|
||||
}
|
||||
}
|
||||
return PASS;
|
||||
|
||||
@@ -70,11 +70,11 @@ public class GlideCheck {
|
||||
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||
Location prev = player.getLocation();
|
||||
prev.setY(prev.getY() - distanceToFall(prev));
|
||||
player.teleport(AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId()).getGoodLocation(prev));
|
||||
player.teleport(AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
||||
.getGoodLocation(prev));
|
||||
}
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"type=glide, desc_amount="
|
||||
+ new BigDecimal(yDiff).setScale(2, RoundingMode.HALF_UP) + ")");
|
||||
"type=glide, desc_amount=" + new BigDecimal(yDiff).setScale(2, RoundingMode.HALF_UP) + ")");
|
||||
} else {
|
||||
VIOLATIONS.put(player.getUniqueId(), VIOLATIONS.get(player.getUniqueId()) + 1);
|
||||
}
|
||||
|
||||
@@ -68,14 +68,19 @@ public class SpeedCheck {
|
||||
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_POTION();
|
||||
}
|
||||
} else if (player.isSprinting()) {
|
||||
if (player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().name().endsWith("ICE")) {
|
||||
reason = "while sprinting on ice ";
|
||||
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT() + 0.165D;
|
||||
String blockDownName = player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().name();
|
||||
if (blockDownName.endsWith("ICE")
|
||||
&& ((player.getEyeLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.AIR)
|
||||
&& (player.getEyeLocation().getBlock().getRelative(BlockFace.UP)
|
||||
.getType() != Material.CAVE_AIR))) {
|
||||
reason = "while boosting on " + blockDownName.toLowerCase().replaceAll("_", " ") + " ";
|
||||
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT()
|
||||
+ (blockDownName.equals("BLUE_ICE") ? 0.20925D : 0.165D);
|
||||
} else {
|
||||
reason = "while sprinting ";
|
||||
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float speed = player.getWalkSpeed();
|
||||
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
|
||||
|
||||
@@ -36,8 +36,7 @@ import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||
|
||||
/**
|
||||
* This check should be replaced
|
||||
* It works, but not great
|
||||
* This check should be replaced It works, but not great
|
||||
*/
|
||||
public class WaterWalkCheck {
|
||||
|
||||
@@ -56,32 +55,32 @@ public class WaterWalkCheck {
|
||||
if (IS_IN_WATER.contains(uuid)) {
|
||||
if (IS_IN_WATER_CACHE.contains(uuid)) {
|
||||
if (player.getNearbyEntities(1, 1, 1).isEmpty()) {
|
||||
boolean b;
|
||||
boolean violation;
|
||||
if (!Utilities.sprintFly(player)) {
|
||||
b = x > AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_WATER()
|
||||
violation = x > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.XZ_SPEED_MAX_WATER()
|
||||
|| z > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.XZ_SPEED_MAX_WATER();
|
||||
} else {
|
||||
b = x > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
violation = x > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.XZ_SPEED_MAX_WATER_SPRINT()
|
||||
|| z > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.XZ_SPEED_MAX_WATER_SPRINT();
|
||||
}
|
||||
if (!b && !Utilities.isFullyInWater(player.getLocation())
|
||||
if (!violation && !Utilities.isFullyInWater(player.getLocation())
|
||||
&& Utilities.isHoveringOverWater(player.getLocation(), 1) && y == 0D
|
||||
&& !block.getType().equals(Material.LILY_PAD)) {
|
||||
b = true;
|
||||
violation = true;
|
||||
}
|
||||
if (b) {
|
||||
if (violation) {
|
||||
if (WATER_SPEED_VIOLATIONS.containsKey(uuid)) {
|
||||
int v = WATER_SPEED_VIOLATIONS.get(uuid);
|
||||
if (v >= AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.WATER_SPEED_VIOLATION_MAX()) {
|
||||
WATER_SPEED_VIOLATIONS.put(uuid, 0);
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"stood on water " + v + " times (can't stand on "
|
||||
+ block.getType() + " or "
|
||||
+ block.getRelative(BlockFace.DOWN).getType() + ")");
|
||||
"stood on water " + v + " times (can't stand on " + block.getType()
|
||||
+ " or " + block.getRelative(BlockFace.DOWN).getType() + ")");
|
||||
} else {
|
||||
WATER_SPEED_VIOLATIONS.put(uuid, v + 1);
|
||||
}
|
||||
@@ -106,8 +105,8 @@ public class WaterWalkCheck {
|
||||
if (v >= AntiCheatReloaded.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {
|
||||
WATER_ASCENSION_VIOLATIONS.put(uuid, 0);
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
"stood on water " + v + " times (can't stand on " + block.getType()
|
||||
+ " or " + block.getRelative(BlockFace.DOWN).getType() + ")");
|
||||
"stood on water " + v + " times (can't stand on " + block.getType() + " or "
|
||||
+ block.getRelative(BlockFace.DOWN).getType() + ")");
|
||||
} else {
|
||||
WATER_ASCENSION_VIOLATIONS.put(uuid, v + 1);
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ public class YAxisCheck {
|
||||
if (y1 > LAST_Y_COORD_CACHE.get(uuid)
|
||||
&& Y_AXIS_VIOLATIONS.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.Y_MAXVIOLATIONS()
|
||||
&& (System.currentTimeMillis() - LAST_Y_AXIS_VIOLATION.get(uuid)) < AntiCheatReloaded.getManager()
|
||||
.getBackend().getMagic().Y_MAXVIOTIME()) {
|
||||
&& (System.currentTimeMillis() - LAST_Y_AXIS_VIOLATION.get(uuid)) < AntiCheatReloaded
|
||||
.getManager().getBackend().getMagic().Y_MAXVIOTIME()) {
|
||||
Location g = player.getLocation();
|
||||
Y_AXIS_VIOLATIONS.put(uuid, Y_AXIS_VIOLATIONS.get(uuid) + 1);
|
||||
LAST_Y_AXIS_VIOLATION.put(uuid, System.currentTimeMillis());
|
||||
@@ -107,11 +107,11 @@ public class YAxisCheck {
|
||||
player.teleport(g);
|
||||
}
|
||||
}
|
||||
return new CheckResult(CheckResult.Result.FAILED, "tried to fly on y-axis in "
|
||||
+ i + " ms (min =" + AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME() + ")");
|
||||
return new CheckResult(CheckResult.Result.FAILED, "tried to fly on y-axis in " + i + " ms (min ="
|
||||
+ AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME() + ")");
|
||||
} else {
|
||||
if ((y1 - LAST_Y_COORD_CACHE.get(uuid)) > AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXDIFF()
|
||||
+ 1
|
||||
if ((y1 - LAST_Y_COORD_CACHE.get(uuid)) > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.Y_MAXDIFF() + 1
|
||||
|| (System.currentTimeMillis() - LAST_Y_TIME.get(uuid)) > AntiCheatReloaded.getManager()
|
||||
.getBackend().getMagic().Y_TIME()) {
|
||||
LAST_Y_TIME.put(uuid, System.currentTimeMillis());
|
||||
|
||||
Reference in new issue
Block a user