mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 22:15:28 +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
|
@EventHandler
|
||||||
public void onPlayerToggleSprint(PlayerToggleSprintEvent event) {
|
public void onPlayerToggleSprint(PlayerToggleSprintEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
if(!event.isSprinting()) {
|
||||||
|
getBackend().logEnterExit(player);
|
||||||
|
}
|
||||||
if (getCheckManager().willCheck(player, CheckType.SPRINT)) {
|
if (getCheckManager().willCheck(player, CheckType.SPRINT)) {
|
||||||
CheckResult result = getBackend().checkSprintHungry(event);
|
CheckResult result = getBackend().checkSprintHungry(event);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ public class Backend {
|
|||||||
|
|
||||||
float speed = player.getWalkSpeed();
|
float speed = player.getWalkSpeed();
|
||||||
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
|
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
|
||||||
|
|
||||||
if (x > max || z > max) {
|
if (x > max || z > max) {
|
||||||
int num = this.increment(player, speedViolation, magic.SPEED_MAX);
|
int num = this.increment(player, speedViolation, magic.SPEED_MAX);
|
||||||
if(num >= magic.SPEED_MAX) {
|
if(num >= magic.SPEED_MAX) {
|
||||||
@@ -362,9 +362,9 @@ public class Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CheckResult checkSprintStill(Player player, Location from, Location to) {
|
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 new CheckResult(Result.FAILED, player.getName()+" sprinted while standing still (xyz = "+(int)from.getX()+","+(int)from.getY()+","+(int)from.getZ()+")");
|
||||||
}
|
}*/
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,7 +522,7 @@ public class Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CheckResult checkSight(Player player, Entity entity) {
|
public CheckResult checkSight(Player player, Entity entity) {
|
||||||
if (entity instanceof LivingEntity) {
|
/*if (entity instanceof LivingEntity) {
|
||||||
LivingEntity le = (LivingEntity) entity;
|
LivingEntity le = (LivingEntity) entity;
|
||||||
// Check to make sure the entity's head is not surrounded
|
// 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());
|
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 new CheckResult(Result.FAILED, player.getName()+" tried to damage an entity ("+le.getType()+") out of sight ");
|
||||||
}
|
}*/
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -634,11 +634,7 @@ public class Backend {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!justAnimated(player, block)) {
|
return PASS;
|
||||||
return new CheckResult(Result.FAILED, player.getName()+" didn't animate before breaking a block of "+block.getType());
|
|
||||||
} else {
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckResult checkFastBreak(Player player, Block block) {
|
public CheckResult checkFastBreak(Player player, Block block) {
|
||||||
@@ -978,7 +974,7 @@ public class Backend {
|
|||||||
|
|
||||||
public void logTeleport(final Player player) {
|
public void logTeleport(final Player player) {
|
||||||
movingExempt.put(player.getName(), System.currentTimeMillis() + magic.TELEPORT_TIME);
|
movingExempt.put(player.getName(), System.currentTimeMillis() + magic.TELEPORT_TIME);
|
||||||
|
|
||||||
/* Data for fly/speed should be reset */
|
/* Data for fly/speed should be reset */
|
||||||
nofallViolation.remove(player.getName());
|
nofallViolation.remove(player.getName());
|
||||||
blocksOverFlight.remove(player.getName());
|
blocksOverFlight.remove(player.getName());
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class CheckManager {
|
|||||||
* @return true if the player's world is enabled
|
* @return true if the player's world is enabled
|
||||||
*/
|
*/
|
||||||
public boolean checkInWorld(Player player) {
|
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>();
|
ArrayList<String> messageArray = new ArrayList<String>();
|
||||||
for (int i = 0; i < alert.size(); i++) {
|
for (int i = 0; i < alert.size(); i++) {
|
||||||
String message = alert.get(i);
|
String message = alert.get(i);
|
||||||
message = message.replaceAll("&player", GOLD + user.getName() + GRAY);
|
if(!message.equals("")) {
|
||||||
message = message.replaceAll("&check", GOLD + CheckType.getName(type) + GRAY);
|
message = message.replaceAll("&player", GOLD + user.getName() + GRAY);
|
||||||
message = message.replaceAll("&level", level.getColor() + level.getName() + GRAY);
|
message = message.replaceAll("&check", GOLD + CheckType.getName(type) + GRAY);
|
||||||
messageArray.add(message);
|
message = message.replaceAll("&level", level.getColor() + level.getName() + GRAY);
|
||||||
|
messageArray.add(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Utilities.alert(messageArray);
|
Utilities.alert(messageArray);
|
||||||
execute(user, level.getActions(), type);
|
execute(user, level.getActions(), type);
|
||||||
@@ -236,5 +238,5 @@ public class UserManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user