Fix for whatever messed up when I merged the sneaking if statements.

This commit is contained in:
Adam committed 2012-05-05 15:37:20 -04:00
1 parent 55eb3738f7
commit f66db829f7
1 file changed
+7 -1
@@ -232,7 +232,11 @@ public class PlayerListener implements Listener {
//Nothing to do //Nothing to do
} }
//Otherwise, are they sneaking? //Otherwise, are they sneaking?
else if(player.isSneaking() && !player.hasPermission("anticheat.sneakhack") && !player.isFlying() && xd > 0.2D || zd > 0.2D) else if(player.isSneaking())
{
if(!player.hasPermission("anticheat.sneakhack") && !player.isFlying())
{
if(xd > 0.2D || zd > 0.2D)
{ {
tracker.increaseLevel(player,2); tracker.increaseLevel(player,2);
plugin.log(player.getName()+" is sneaking too fast! "+speed); plugin.log(player.getName()+" is sneaking too fast! "+speed);
@@ -240,6 +244,8 @@ public class PlayerListener implements Listener {
//If they are, force them out of it. //If they are, force them out of it.
player.setSneaking(false); player.setSneaking(false);
} }
}
}
//Otherwise set a hardcoded limit to any other traveling //Otherwise set a hardcoded limit to any other traveling
else if(xd > 0.4D || zd > 0.4D) else if(xd > 0.4D || zd > 0.4D)
{ {