Changed to Visuals Check

This commit is contained in:
Super Spy committed 2012-06-05 15:41:43 -05:00
1 parent 1b8d3c5e50
commit 3a8c591c5b
3 files changed
+7 -23

No files matched your search

@@ -152,17 +152,17 @@ public class PlayerListener extends EventListener
backend.checkLongReachBlock(player,distance.getXDifference(), distance.getYDifference(), distance.getZDifference());
}
/* Chest Cheat Check */
/* Visuals Check */
if(event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK)
{
Block block = event.getClickedBlock();
if(((block.getType()) == Material.CHEST) && checkManager.willCheck(player, CheckType.CHEST_HACK))
if(checkManager.willCheck(player, CheckType.VISUALS))
{
// save load and actually call the backend check here.
if(backend.checkChestCheat(player, block))
if(backend.checkVisuals(player, block))
{
event.setCancelled(true);
log("tried to use freecam chest hack",player,CheckType.CHEST_HACK);
log("failed visuals check",player,CheckType.VISUALS);
}
}
}
@@ -261,7 +261,7 @@ public class Backend
}
}
public boolean checkChestCheat(Player player, Block block)
public boolean checkVisuals(Player player, Block block)
{
// The most complicated check in the world...approaching nirvana.
int strikes = 0;
@@ -327,8 +327,6 @@ public class Backend
player.sendMessage("Block detected at -X: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 56, (byte) 0);
}
}
}
@@ -360,8 +358,6 @@ public class Backend
player.sendMessage("Block detected at -Z: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 57, (byte) 0);
}
}
}
@@ -397,8 +393,6 @@ public class Backend
player.sendMessage("Block detected at +X: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 35, (byte) 0);
}
}
}
@@ -430,8 +424,6 @@ public class Backend
player.sendMessage("Block detected at -Z: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 57, (byte) 0);
}
}
}
@@ -449,8 +441,6 @@ public class Backend
player.sendMessage("Block detected at +X: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 35, (byte) 0);
}
}
}
@@ -465,8 +455,6 @@ public class Backend
player.sendMessage("Block detected at +Z: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 1, (byte) 0);
}
}
}
@@ -494,8 +482,6 @@ public class Backend
player.sendMessage("Block detected at -X: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 56, (byte) 0);
}
}
}
@@ -520,8 +506,6 @@ public class Backend
player.sendMessage("Block detected at +Z: " + a + " Block: " + coords.getBlock().getType().toString());
player.sendBlockChange(coords, 46, (byte) 0);
strikes++;
} else {
player.sendBlockChange(coords, 1, (byte) 0);
}
}
}
@@ -532,7 +516,7 @@ public class Backend
player.sendMessage("Strikes: " + strikes + " Dir: " + direction);
player.sendMessage("X: " + x + " Y: " + y + " Z:" + z);
return false;
return strikes > 0;
}
public boolean checkWaterWalk(Player player, double x, double z)
@@ -38,7 +38,7 @@ public enum CheckType
WATER_WALK("anticheat.waterwalk"),
NO_SWING("anticheat.noswing"),
FAST_BREAK("anticheat.fastbreak"),
CHEST_HACK("anticheat.chest"),
VISUALS("anticheat.visuals"),
FAST_PLACE("anticheat.fastplace"),
SPAM("anticheat.spam"),
SPRINT("anticheat.sprint"),