mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 22:15:28 +00:00
A few extra permissions..
This commit is contained in:
1 parent
b6caa519b9
commit
63868d6a25
2 files changed
+17
-3
No files matched your search
@@ -35,12 +35,17 @@ public class BlockListener implements Listener {
|
|||||||
{
|
{
|
||||||
//Check if an animation was done before this
|
//Check if an animation was done before this
|
||||||
if(!am.swungArm(player))
|
if(!am.swungArm(player))
|
||||||
|
{
|
||||||
|
if(!player.hasPermission("anticheat.noswing"))
|
||||||
{
|
{
|
||||||
tracker.increaseLevel(player);
|
tracker.increaseLevel(player);
|
||||||
plugin.log(player.getName()+" didn't swing their arm on a block break!");
|
plugin.log(player.getName()+" didn't swing their arm on a block break!");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if(!player.hasPermission("anticheat.longreach"))
|
||||||
{
|
{
|
||||||
//If so, check the distance from the block. Is it too far away?
|
//If so, check the distance from the block. Is it too far away?
|
||||||
LengthCheck c = new LengthCheck(block.getLocation(),event.getPlayer().getLocation());
|
LengthCheck c = new LengthCheck(block.getLocation(),event.getPlayer().getLocation());
|
||||||
@@ -56,6 +61,7 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
am.reset(player);
|
am.reset(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,9 +81,11 @@ public class BlockListener implements Listener {
|
|||||||
//TODO: this is causing false alerts. Re-work the vision logic?
|
//TODO: this is causing false alerts. Re-work the vision logic?
|
||||||
//tracker.increaseLevel(player);
|
//tracker.increaseLevel(player);
|
||||||
plugin.log(player.getName()+" tried to place a block that they couldn't see!");
|
plugin.log(player.getName()+" tried to place a block that they couldn't see!");
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!player.hasPermission("anticheat.longreach"))
|
||||||
|
{
|
||||||
//Is the player too far away?
|
//Is the player too far away?
|
||||||
LengthCheck c = new LengthCheck(block.getLocation(),event.getPlayer().getLocation());
|
LengthCheck c = new LengthCheck(block.getLocation(),event.getPlayer().getLocation());
|
||||||
if(c.getXDifference() > 6.0D || c.getZDifference() > 6.0D || c.getYDifference() > 6.0D)
|
if(c.getXDifference() > 6.0D || c.getZDifference() > 6.0D || c.getYDifference() > 6.0D)
|
||||||
@@ -91,6 +99,7 @@ public class BlockListener implements Listener {
|
|||||||
tracker.decreaseLevel(player);
|
tracker.decreaseLevel(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
am.reset(player);
|
am.reset(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ package net.h31ix.anticheat.event;
|
|||||||
|
|
||||||
import net.h31ix.anticheat.Anticheat;
|
import net.h31ix.anticheat.Anticheat;
|
||||||
import net.h31ix.anticheat.PlayerTracker;
|
import net.h31ix.anticheat.PlayerTracker;
|
||||||
import net.h31ix.anticheat.checks.EyeCheck;
|
|
||||||
import net.h31ix.anticheat.checks.LengthCheck;
|
import net.h31ix.anticheat.checks.LengthCheck;
|
||||||
import net.h31ix.anticheat.manage.BowManager;
|
import net.h31ix.anticheat.manage.BowManager;
|
||||||
import net.h31ix.anticheat.manage.ExemptManager;
|
import net.h31ix.anticheat.manage.ExemptManager;
|
||||||
@@ -33,8 +32,10 @@ public class EntityListener implements Listener {
|
|||||||
{
|
{
|
||||||
if(event.getEntity() instanceof Player)
|
if(event.getEntity() instanceof Player)
|
||||||
{
|
{
|
||||||
//This mostly prevents bow spam, hopefully more auto-firing in the future
|
|
||||||
Player player = (Player)event.getEntity();
|
Player player = (Player)event.getEntity();
|
||||||
|
if(!player.hasPermission("anticheat.autofire"))
|
||||||
|
{
|
||||||
|
//This mostly prevents bow spam, hopefully more auto-firing in the future
|
||||||
if(!bm.hasShot(player))
|
if(!bm.hasShot(player))
|
||||||
{
|
{
|
||||||
tracker.decreaseLevel(player);
|
tracker.decreaseLevel(player);
|
||||||
@@ -48,6 +49,7 @@ public class EntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityDamage(EntityDamageEvent event)
|
public void onEntityDamage(EntityDamageEvent event)
|
||||||
@@ -70,6 +72,8 @@ public class EntityListener implements Listener {
|
|||||||
time = 100;
|
time = 100;
|
||||||
}
|
}
|
||||||
ex.logHit(p,50);
|
ex.logHit(p,50);
|
||||||
|
if(!p.hasPermission("anticheat.longreach"))
|
||||||
|
{
|
||||||
//Make sure they are close enough to the entity to hit them
|
//Make sure they are close enough to the entity to hit them
|
||||||
LengthCheck lc = new LengthCheck(event.getEntity().getLocation(),p.getLocation());
|
LengthCheck lc = new LengthCheck(event.getEntity().getLocation(),p.getLocation());
|
||||||
if(lc.getXDifference() > 5.0D || lc.getZDifference() > 5.0D || lc.getYDifference() > 4.3D)
|
if(lc.getXDifference() > 5.0D || lc.getZDifference() > 5.0D || lc.getYDifference() > 4.3D)
|
||||||
@@ -81,4 +85,5 @@ public class EntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user