mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Remove outdated checks
This commit is contained in:
1 parent
d87d140743
commit
584b3b8dd5
4 files changed
+18
-17
No files matched your search
@@ -169,6 +169,9 @@ public class PlayerListener extends EventListener {
|
||||
@EventHandler
|
||||
public void onPlayerToggleSprint(PlayerToggleSprintEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if(!event.isSprinting()) {
|
||||
getBackend().logEnterExit(player);
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.SPRINT)) {
|
||||
CheckResult result = getBackend().checkSprintHungry(event);
|
||||
if (result.failed()) {
|
||||
|
||||
@@ -322,7 +322,7 @@ public class Backend {
|
||||
|
||||
float speed = player.getWalkSpeed();
|
||||
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
|
||||
|
||||
|
||||
if (x > max || z > max) {
|
||||
int num = this.increment(player, speedViolation, magic.SPEED_MAX);
|
||||
if(num >= magic.SPEED_MAX) {
|
||||
@@ -362,9 +362,9 @@ public class Backend {
|
||||
}
|
||||
|
||||
public CheckResult checkSprintStill(Player player, Location from, Location to) {
|
||||
if(!isMovingExempt(player) && player.isSprinting() && from.getX() == to.getX() && from.getZ() == to.getZ()) {
|
||||
/*if(!isMovingExempt(player) && player.isSprinting() && from.getX() == to.getX() && from.getZ() == to.getZ()) {
|
||||
return new CheckResult(Result.FAILED, player.getName()+" sprinted while standing still (xyz = "+(int)from.getX()+","+(int)from.getY()+","+(int)from.getZ()+")");
|
||||
}
|
||||
}*/
|
||||
return PASS;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ public class Backend {
|
||||
}
|
||||
|
||||
public CheckResult checkSight(Player player, Entity entity) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
/*if (entity instanceof LivingEntity) {
|
||||
LivingEntity le = (LivingEntity) entity;
|
||||
// Check to make sure the entity's head is not surrounded
|
||||
Block head = le.getWorld().getBlockAt((int) le.getLocation().getX(), (int) (le.getLocation().getY() + le.getEyeHeight()), (int) le.getLocation().getZ());
|
||||
@@ -553,7 +553,7 @@ public class Backend {
|
||||
}
|
||||
}
|
||||
return new CheckResult(Result.FAILED, player.getName()+" tried to damage an entity ("+le.getType()+") out of sight ");
|
||||
}
|
||||
}*/
|
||||
return PASS;
|
||||
}
|
||||
|
||||
@@ -634,11 +634,7 @@ public class Backend {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!justAnimated(player, block)) {
|
||||
return new CheckResult(Result.FAILED, player.getName()+" didn't animate before breaking a block of "+block.getType());
|
||||
} else {
|
||||
return PASS;
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
|
||||
public CheckResult checkFastBreak(Player player, Block block) {
|
||||
@@ -978,7 +974,7 @@ public class Backend {
|
||||
|
||||
public void logTeleport(final Player player) {
|
||||
movingExempt.put(player.getName(), System.currentTimeMillis() + magic.TELEPORT_TIME);
|
||||
|
||||
|
||||
/* Data for fly/speed should be reset */
|
||||
nofallViolation.remove(player.getName());
|
||||
blocksOverFlight.remove(player.getName());
|
||||
|
||||
@@ -137,7 +137,7 @@ public class CheckManager {
|
||||
* @return true if the player's world is enabled
|
||||
*/
|
||||
public boolean checkInWorld(Player player) {
|
||||
return config.getConfig().exemptedWorlds.getValue().contains(player.getWorld());
|
||||
return !config.getConfig().exemptedWorlds.getValue().contains(player.getWorld().getName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -169,10 +169,12 @@ public class UserManager {
|
||||
ArrayList<String> messageArray = new ArrayList<String>();
|
||||
for (int i = 0; i < alert.size(); i++) {
|
||||
String message = alert.get(i);
|
||||
message = message.replaceAll("&player", GOLD + user.getName() + GRAY);
|
||||
message = message.replaceAll("&check", GOLD + CheckType.getName(type) + GRAY);
|
||||
message = message.replaceAll("&level", level.getColor() + level.getName() + GRAY);
|
||||
messageArray.add(message);
|
||||
if(!message.equals("")) {
|
||||
message = message.replaceAll("&player", GOLD + user.getName() + GRAY);
|
||||
message = message.replaceAll("&check", GOLD + CheckType.getName(type) + GRAY);
|
||||
message = message.replaceAll("&level", level.getColor() + level.getName() + GRAY);
|
||||
messageArray.add(message);
|
||||
}
|
||||
}
|
||||
Utilities.alert(messageArray);
|
||||
execute(user, level.getActions(), type);
|
||||
@@ -236,5 +238,5 @@ public class UserManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user