Skip to content

Commit

Permalink
Fix KillAura false positive with Trident (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rammelkast committed Dec 10, 2021
1 parent 15ba2a0 commit e71707a
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.util.Vector;

import com.cryptomorin.xseries.XMaterial;
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.CheckResult;
import com.rammelkast.anticheatreloaded.check.CheckType;
Expand Down Expand Up @@ -96,17 +97,18 @@ public static CheckResult checkReach(final Player player, final Entity target) {
public static CheckResult checkAngle(final Player player, final EntityDamageEvent event) {
final UUID uuid = player.getUniqueId();
final Entity entity = event.getEntity();

// Do not check while in vehicles
if (player.getVehicle() != null || entity.getVehicle() != null || player.getItemInUse() == XMaterial.TRIDENT.parseItem()) {
return PASS;
}

final Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();

// Check if enabled
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;
Expand Down

0 comments on commit e71707a

Please sign in to comment.