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
+6 -1
@@ -48,7 +48,7 @@ public final class KillAuraCheck {
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED); private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static CheckResult checkReach(final Player player, final Entity target) { 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; return PASS;
} }
@@ -103,6 +103,11 @@ public final class KillAuraCheck {
return PASS; return PASS;
} }
// Do not check while in vehicles
if (player.getVehicle() != null || entity.getVehicle() != null) {
return PASS;
}
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
final LivingEntity living = (LivingEntity) entity; final LivingEntity living = (LivingEntity) entity;
final Location eyeLocation = player.getEyeLocation(); final Location eyeLocation = player.getEyeLocation();