mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Ops have hack warning permission.
This commit is contained in:
1 parent
d2e4301847
commit
fbe417426f
3 files changed
+13
-4
No files matched your search
@@ -31,7 +31,7 @@ public class PlayerTracker {
|
||||
execute("Medium",player);
|
||||
for(Player p : player.getServer().getOnlinePlayers())
|
||||
{
|
||||
if(p.hasPermission("anticheat.admin"))
|
||||
if(p.hasPermission("anticheat.admin") || p.isOp())
|
||||
{
|
||||
p.sendMessage(ChatColor.YELLOW+"[ALERT] "+ChatColor.WHITE+player.getName()+ChatColor.YELLOW+" has entered the MEDIUM hack level.");
|
||||
p.sendMessage(ChatColor.YELLOW+"[ALERT] This means they may be using a hacked client or may have a bad connection!");
|
||||
@@ -43,7 +43,7 @@ public class PlayerTracker {
|
||||
execute("High",player);
|
||||
for(Player p : player.getServer().getOnlinePlayers())
|
||||
{
|
||||
if(p.hasPermission("anticheat.admin"))
|
||||
if(p.hasPermission("anticheat.admin") || p.isOp())
|
||||
{
|
||||
p.sendMessage(ChatColor.RED+"[ALERT] "+ChatColor.WHITE+player.getName()+ChatColor.RED+" has entered the HIGH hack level.");
|
||||
p.sendMessage(ChatColor.RED+"[ALERT] This means they probably are hacking or are lagging out!");
|
||||
|
||||
@@ -34,5 +34,5 @@ public class EyeCheck {
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package net.h31ix.anticheat.event;
|
||||
|
||||
import net.h31ix.anticheat.Anticheat;
|
||||
import net.h31ix.anticheat.PlayerTracker;
|
||||
import net.h31ix.anticheat.checks.EyeCheck;
|
||||
import net.h31ix.anticheat.checks.LengthCheck;
|
||||
import net.h31ix.anticheat.manage.*;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@@ -123,8 +124,14 @@ public class EntityListener implements Listener {
|
||||
public void onEntityDamage(EntityDamageEvent event)
|
||||
{
|
||||
if (event instanceof EntityDamageByEntityEvent)
|
||||
{
|
||||
{
|
||||
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
||||
if (e.getDamager() instanceof Player)
|
||||
{
|
||||
Player p = (Player) e.getDamager();
|
||||
System.out.println("CAUSE: "+event.getCause().name());
|
||||
System.out.println("DAMAGE: "+event.getDamage());
|
||||
}
|
||||
if(event.getEntity() instanceof Player)
|
||||
{
|
||||
Player player = (Player)event.getEntity();
|
||||
@@ -148,6 +155,8 @@ public class EntityListener implements Listener {
|
||||
LengthCheck lc = new LengthCheck(event.getEntity().getLocation(),p.getLocation());
|
||||
if(lc.getXDifference() > 5.0D || lc.getZDifference() > 5.0D || lc.getYDifference() > 4.3D)
|
||||
{
|
||||
tracker.increaseLevel(player,2);
|
||||
plugin.log(player.getName()+" tried to hit an entity too far away!");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user