Remove outdated checks

This commit is contained in:
h31ix committed 2013-09-23 20:05:51 -04:00
1 parent d87d140743
commit 584b3b8dd5
4 files changed
+10 -9

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()) {
@@ -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,12 +634,8 @@ 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) { public CheckResult checkFastBreak(Player player, Block block) {
int violations = magic.FASTBREAK_MAXVIOLATIONS; int violations = magic.FASTBREAK_MAXVIOLATIONS;
@@ -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,11 +169,13 @@ 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);
if(!message.equals("")) {
message = message.replaceAll("&player", GOLD + user.getName() + GRAY); message = message.replaceAll("&player", GOLD + user.getName() + GRAY);
message = message.replaceAll("&check", GOLD + CheckType.getName(type) + GRAY); message = message.replaceAll("&check", GOLD + CheckType.getName(type) + GRAY);
message = message.replaceAll("&level", level.getColor() + level.getName() + GRAY); message = message.replaceAll("&level", level.getColor() + level.getName() + GRAY);
messageArray.add(message); messageArray.add(message);
} }
}
Utilities.alert(messageArray); Utilities.alert(messageArray);
execute(user, level.getActions(), type); execute(user, level.getActions(), type);
} }