Fix KillAura false positive

This commit is contained in:
Rammelkast committed 2021-09-24 12:09:50 +02:00
1 parent 5f1dc37679
commit 9550cc1d09
1 file changed
+7 -2
@@ -48,10 +48,10 @@ public final class KillAuraCheck {
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static CheckResult checkReach(final Player player, final Entity target) {
if (!(target instanceof LivingEntity)) {
if (!(target instanceof LivingEntity) || player.getVehicle() != null || target.getVehicle() != null) {
return PASS;
}
final User user = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId());
final Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
@@ -102,6 +102,11 @@ public final class KillAuraCheck {
if (!checksConfig.isSubcheckEnabled(CheckType.KILLAURA, "angle")) {
return PASS;
}
// Do not check while in vehicles
if (player.getVehicle() != null || entity.getVehicle() != null) {
return PASS;
}
if (entity instanceof LivingEntity) {
final LivingEntity living = (LivingEntity) entity;