From 531b7a4985859a98a030d46b55305fccc32762ee Mon Sep 17 00:00:00 2001 From: H31IX Date: Thu, 30 Aug 2012 00:09:27 -0400 Subject: [PATCH] Fixed crouching on slabs in mid-air --- src/main/java/net/h31ix/anticheat/manage/Backend.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/net/h31ix/anticheat/manage/Backend.java b/src/main/java/net/h31ix/anticheat/manage/Backend.java index 2728d42..fb49295 100644 --- a/src/main/java/net/h31ix/anticheat/manage/Backend.java +++ b/src/main/java/net/h31ix/anticheat/manage/Backend.java @@ -668,6 +668,14 @@ public class Backend //Even if they are using a hacked client and flying next to water to abuse this, they can't be go past the speed limit so they might as well swim return distance.getYDifference() > WATER_CLIMB_MAX; } + //Check if the player is crouching on slabs + if(player.isSneaking()) + { + if(block.getRelative(BlockFace.NORTH).getTypeId() == 43 || block.getRelative(BlockFace.NORTH).getTypeId() == 44 || block.getRelative(BlockFace.SOUTH).getTypeId() == 43 || block.getRelative(BlockFace.SOUTH).getTypeId() == 44 || block.getRelative(BlockFace.EAST).getTypeId() == 43 || block.getRelative(BlockFace.EAST).getTypeId() == 44 || block.getRelative(BlockFace.WEST).getTypeId() == 43 || block.getRelative(BlockFace.WEST).getTypeId() == 44) + { + return false; + } + } int violation = flightViolation.containsKey(name) ? flightViolation.get(name)+1 : 1; increment(player, flightViolation, violation); if(violation > FLIGHT_LIMIT)