mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +00:00
All players who take damage now get ignored for a bit, fixes entities getting hit in water and still getting moved too fast messages.
This commit is contained in:
1 parent
d7b0dfbbfc
commit
db0ad84614
3 files changed
+29
-9
No files matched your search
@@ -141,5 +141,20 @@ public class CommandManager implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static void sort(int a[],int n)
|
||||||
|
{
|
||||||
|
int i, j,t=0;
|
||||||
|
for(i = 0; i < n; i++)
|
||||||
|
{
|
||||||
|
for(j = 1; j < (n-i); j++)
|
||||||
|
{
|
||||||
|
if(a[j-1] > a[j])
|
||||||
|
{
|
||||||
|
t = a[j-1];
|
||||||
|
a[j-1]=a[j];
|
||||||
|
a[j]=t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -132,14 +132,14 @@ public class EntityListener implements Listener {
|
|||||||
}, 2);
|
}, 2);
|
||||||
}
|
}
|
||||||
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
||||||
if (e.getDamager() instanceof Player)
|
if(event.getEntity() instanceof Player)
|
||||||
{
|
{
|
||||||
Player p = (Player) e.getDamager();
|
Player player = (Player)event.getEntity();
|
||||||
if(plugin.check(p))
|
if(plugin.check(player))
|
||||||
{
|
{
|
||||||
if(event.getEntity() instanceof Player)
|
if (e.getDamager() instanceof Player)
|
||||||
{
|
{
|
||||||
Player player = (Player)event.getEntity();
|
Player p = (Player) e.getDamager();
|
||||||
//Being damaged causes the player to move really fast, usually triggering a warning and
|
//Being damaged causes the player to move really fast, usually triggering a warning and
|
||||||
//A teleport, so give them a grace period after damaging someone or being hit for recovery.
|
//A teleport, so give them a grace period after damaging someone or being hit for recovery.
|
||||||
int time = 50;
|
int time = 50;
|
||||||
@@ -160,6 +160,10 @@ public class EntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
ex.logHit(player,time);
|
ex.logHit(player,time);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ex.logHit(player,50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ public class PlayerListener implements Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if(!player.hasPermission("anticheat.teleport") && !tp.didTeleport(player) && event.getCause() == TeleportCause.UNKNOWN)
|
if(!player.hasPermission("anticheat.teleport") && !tp.didTeleport(player) && event.getCause() == TeleportCause.UNKNOWN)
|
||||||
{
|
{
|
||||||
|
System.out.println(event.getFrom().getBlock().getRelative(BlockFace.DOWN).getType().name());
|
||||||
plugin.log(player.getName()+" tried to teleport without cause!");
|
plugin.log(player.getName()+" tried to teleport without cause!");
|
||||||
tracker.increaseLevel(player,3);
|
tracker.increaseLevel(player,3);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|||||||
Reference in new issue
Block a user