mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 22:15:28 +00:00
Changed to Visuals Check
This commit is contained in:
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());
|
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)
|
if(event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
||||||
{
|
{
|
||||||
Block block = event.getClickedBlock();
|
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.
|
// save load and actually call the backend check here.
|
||||||
if(backend.checkChestCheat(player, block))
|
if(backend.checkVisuals(player, block))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
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.
|
// The most complicated check in the world...approaching nirvana.
|
||||||
int strikes = 0;
|
int strikes = 0;
|
||||||
@@ -327,8 +327,6 @@ public class Backend
|
|||||||
player.sendMessage("Block detected at -X: " + a + " Block: " + coords.getBlock().getType().toString());
|
player.sendMessage("Block detected at -X: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
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.sendMessage("Block detected at -Z: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
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.sendMessage("Block detected at +X: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
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.sendMessage("Block detected at -Z: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
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.sendMessage("Block detected at +X: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
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.sendMessage("Block detected at +Z: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
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.sendMessage("Block detected at -X: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
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.sendMessage("Block detected at +Z: " + a + " Block: " + coords.getBlock().getType().toString());
|
||||||
player.sendBlockChange(coords, 46, (byte) 0);
|
player.sendBlockChange(coords, 46, (byte) 0);
|
||||||
strikes++;
|
strikes++;
|
||||||
} else {
|
|
||||||
player.sendBlockChange(coords, 1, (byte) 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -532,7 +516,7 @@ public class Backend
|
|||||||
player.sendMessage("Strikes: " + strikes + " Dir: " + direction);
|
player.sendMessage("Strikes: " + strikes + " Dir: " + direction);
|
||||||
player.sendMessage("X: " + x + " Y: " + y + " Z:" + z);
|
player.sendMessage("X: " + x + " Y: " + y + " Z:" + z);
|
||||||
|
|
||||||
return false;
|
return strikes > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkWaterWalk(Player player, double x, double z)
|
public boolean checkWaterWalk(Player player, double x, double z)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public enum CheckType
|
|||||||
WATER_WALK("anticheat.waterwalk"),
|
WATER_WALK("anticheat.waterwalk"),
|
||||||
NO_SWING("anticheat.noswing"),
|
NO_SWING("anticheat.noswing"),
|
||||||
FAST_BREAK("anticheat.fastbreak"),
|
FAST_BREAK("anticheat.fastbreak"),
|
||||||
CHEST_HACK("anticheat.chest"),
|
VISUALS("anticheat.visuals"),
|
||||||
FAST_PLACE("anticheat.fastplace"),
|
FAST_PLACE("anticheat.fastplace"),
|
||||||
SPAM("anticheat.spam"),
|
SPAM("anticheat.spam"),
|
||||||
SPRINT("anticheat.sprint"),
|
SPRINT("anticheat.sprint"),
|
||||||
|
|||||||
Reference in new issue
Block a user