Skip to content

Commit 5c85b87

Browse files
committed
Small changes to reach check, redid aimbot check, improved default config
Prepared for release.
1 parent 67e6f0d commit 5c85b87

File tree

5 files changed

+26
-37
lines changed

5 files changed

+26
-37
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.rammelkast.anticheatreloaded</groupId>
55
<artifactId>AntiCheatReloaded</artifactId>
6-
<version>1.10.3-PRE</version>
6+
<version>1.10.3</version>
77
<name>AntiCheatReloaded</name>
88
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
99
<properties>

src/main/java/com/rammelkast/anticheatreloaded/check/combat/KillAuraCheck.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ public static CheckResult checkReach(final Player player, final Entity target) {
8585
// Velocity compensation
8686
final double velocityMultiplier = checksConfig.getDouble(CheckType.KILLAURA, "reach", "velocityMultiplier");
8787
allowedReach += Math.abs(target.getVelocity().length()) * velocityMultiplier;
88-
final double reachedDistance = ((LivingEntity) target).getLocation().toVector()
89-
.distance(player.getLocation().toVector());
90-
if (reachedDistance > allowedReach) {
88+
final double reachedDistance = Utilities.roundDouble(((LivingEntity) target).getLocation().toVector()
89+
.distance(player.getLocation().toVector()), 2);
90+
if (reachedDistance > Utilities.roundDouble(allowedReach, 2)) {
9191
return new CheckResult(CheckResult.Result.FAILED, "Reach",
92-
"reached too far (distance=" + Utilities.roundDouble(reachedDistance, 6) + ", max=" + Utilities.roundDouble(allowedReach, 6) + ")");
92+
"reached too far (distance=" + reachedDistance + ", max=" + Utilities.roundDouble(allowedReach, 2) + ")");
9393
}
9494
return PASS;
9595
}

src/main/java/com/rammelkast/anticheatreloaded/check/movement/AimbotCheck.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@
3030
import com.rammelkast.anticheatreloaded.util.User;
3131
import com.rammelkast.anticheatreloaded.util.Utilities;
3232

33-
/*
34-
* TODO redo (again)
35-
* Just go for a basic GCD check and implement optifine detection
36-
*/
3733
public final class AimbotCheck {
3834

35+
private static final double EXPANDER = Math.pow(2, 24);
3936
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
4037

4138
public static CheckResult runCheck(final Player player, final EntityDamageByEntityEvent event) {
@@ -49,19 +46,18 @@ public static CheckResult runCheck(final Player player, final EntityDamageByEnti
4946
final MovementManager movementManager = user.getMovementManager();
5047
final Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
5148
final float deltaPitch = movementManager.deltaPitch;
52-
final float deltaYaw = movementManager.deltaYaw;
5349
final float pitchAcceleration = Math.abs(deltaPitch - movementManager.lastDeltaPitch);
5450

55-
final double gcd = Utilities.computeGcd(deltaPitch, movementManager.lastDeltaPitch);
56-
final double mod = Math.abs(player.getLocation().getPitch() % gcd);
51+
final long gcd = Utilities.getGcd((long) (deltaPitch * EXPANDER),
52+
(long) (movementManager.lastDeltaPitch * EXPANDER));
53+
final double mod = Math.abs(player.getLocation().getPitch() % (gcd / EXPANDER));
5754
final double minAcceleration = checksConfig.getDouble(CheckType.AIMBOT, "minAcceleration");
5855
final double maxMod = checksConfig.getDouble(CheckType.AIMBOT, "maxMod");
59-
if (mod < maxMod && pitchAcceleration > minAcceleration
60-
&& (deltaPitch == 0.0f || (deltaPitch > 45.0f && deltaYaw > 45.0f))) {
56+
if ((gcd > 0L && gcd < 131072L) && mod <= maxMod && pitchAcceleration > minAcceleration && deltaPitch > 5.0f) {
6157
return new CheckResult(CheckResult.Result.FAILED,
62-
"failed computational check (gcd=" + Utilities.roundDouble(gcd, 4) + ", mod="
63-
+ Utilities.roundDouble(mod, 4) + ", accel=" + Utilities.roundDouble(pitchAcceleration, 4)
64-
+ ")");
58+
"failed computational check (gcd=" + gcd + ", mod="
59+
+ Utilities.roundDouble(mod, 5) + ", accel=" + Utilities.roundDouble(pitchAcceleration, 3)
60+
+ ", delta=" + Utilities.roundDouble(deltaPitch, 1) + ")");
6561
}
6662
return PASS;
6763
}

src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -766,22 +766,15 @@ public static float computeAngleDifference(final float a, final float b) {
766766

767767
/**
768768
* Calculates the greatest common divider
769-
* @param a value a
770-
* @param b value b
771-
* @return the greatest common divider of a and b
769+
*
770+
* @param current - The current value
771+
* @param previous - The previous value
772+
* @return - The GCD of those two values
772773
*/
773-
public static double computeGcd(final double a, final double b) {
774-
if (a < b) {
775-
return computeGcd(b, a);
776-
}
774+
public static long getGcd(final long current, final long previous) {
775+
return (previous <= 16384L) ? current : getGcd(previous, current % previous);
776+
}
777777

778-
if (Math.abs(b) < 0.001) {
779-
return a;
780-
} else {
781-
return computeGcd(b, a - Math.floor(a / b) * b);
782-
}
783-
}
784-
785778
public static boolean isCollisionPoint(final Location location, final Predicate<Material> predicate) {
786779
final ArrayList<Material> materials = new ArrayList<>();
787780
for (double x = -0.3; x <= 0.3; x += 0.3) {

src/main/resources/checks.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ speed:
5858
# Should this part of the check be enabled?
5959
enabled: true
6060
# Base unadjusted air speed limit
61-
baseLimit: 0.03125
61+
baseLimit: 0.0315
6262
# Prediction multiplier for custom walk speeds
6363
walkSpeedMultiplier: 1.4
6464
# Checks movement acceleration in the air
@@ -67,7 +67,7 @@ speed:
6767
# Should this part of the check be enabled?
6868
enabled: true
6969
# Base unadjusted air acceleration limit
70-
baseLimit: 0.3725
70+
baseLimit: 0.375
7171
# Limit multiplier for custom walk speeds
7272
walkSpeedMultiplier: 1.4
7373
# Checks movement acceleration in the air
@@ -157,7 +157,7 @@ killaura:
157157
# Maximum base reach distances
158158
baseMaxValue:
159159
# Maximum base reach value
160-
normal: 3.6
160+
normal: 3.5
161161
# Maximum base reach value when a player has velocity
162162
velocitized: 4.0
163163
# Settings for lag compensation
@@ -167,7 +167,7 @@ killaura:
167167
# Extra allowed reach distance per millisecond of ping
168168
pingCompensation: 0.0025
169169
# The multiplier of extra compensation for velocity
170-
velocityMultiplier: 1.2
170+
velocityMultiplier: 1.3
171171
# Checks if the target it within a players viewing angle
172172
# Debugs as 'tried to attack from an illegal angle'
173173
angle:
@@ -194,9 +194,9 @@ aimbot:
194194
# Should this check be enabled?
195195
enabled: true
196196
# Maximum pitch acceleration for check to consider aim illegal
197-
minAcceleration: 0.5
197+
minAcceleration: 5.5
198198
# Maximum mod value for check to consider aim illegal
199-
maxMod: 0.0001
199+
maxMod: 0.001
200200
# Criticals check settings
201201
# Checks if the player tries to do a crit without needed conditions
202202
criticals:

0 commit comments

Comments
 (0)