Fix for sneaking/blocking + velocity.

This commit is contained in:
asofold 2013-03-04 23:37:58 +01:00
parent 11f139a4fa
commit 323d0f07d1

View File

@ -673,6 +673,8 @@ public class SurvivalFly extends Check {
// TODO: maybe re-model ice stuff (check what is really needed). // TODO: maybe re-model ice stuff (check what is really needed).
if (from.isOnIce() || to.isOnIce()) data.sfFlyOnIce = 20; if (from.isOnIce() || to.isOnIce()) data.sfFlyOnIce = 20;
else if (data.sfFlyOnIce > 0) data.sfFlyOnIce--; else if (data.sfFlyOnIce > 0) data.sfFlyOnIce--;
final boolean sfDirty = data.sfDirty;
if (from.isInWeb()) { if (from.isInWeb()) {
data.sfFlyOnIce = 0; data.sfFlyOnIce = 0;
@ -684,8 +686,8 @@ public class SurvivalFly extends Check {
// TODO: too many false positives with just checking from ? // TODO: too many false positives with just checking from ?
// TODO: Sneaking and blocking applies to when in water ! // TODO: Sneaking and blocking applies to when in water !
hAllowedDistance = swimmingSpeed * cc.survivalFlySwimmingSpeed / 100D; hAllowedDistance = swimmingSpeed * cc.survivalFlySwimmingSpeed / 100D;
} else if (player.isSneaking() && reallySneaking.contains(player.getName()) && (!checkPermissions || !player.hasPermission(Permissions.MOVING_SURVIVALFLY_SNEAKING))) hAllowedDistance = sneakingSpeed * cc.survivalFlySneakingSpeed / 100D; } else if (!sfDirty && player.isSneaking() && reallySneaking.contains(player.getName()) && (!checkPermissions || !player.hasPermission(Permissions.MOVING_SURVIVALFLY_SNEAKING))) hAllowedDistance = sneakingSpeed * cc.survivalFlySneakingSpeed / 100D;
else if (player.isBlocking() && (!checkPermissions || !player.hasPermission(Permissions.MOVING_SURVIVALFLY_BLOCKING))) hAllowedDistance = blockingSpeed * cc.survivalFlyBlockingSpeed / 100D; else if (!sfDirty && player.isBlocking() && (!checkPermissions || !player.hasPermission(Permissions.MOVING_SURVIVALFLY_BLOCKING))) hAllowedDistance = blockingSpeed * cc.survivalFlyBlockingSpeed / 100D;
else { else {
if (!sprinting) hAllowedDistance = walkingSpeed * cc.survivalFlyWalkingSpeed / 100D; if (!sprinting) hAllowedDistance = walkingSpeed * cc.survivalFlyWalkingSpeed / 100D;
else hAllowedDistance = sprintingSpeed * cc.survivalFlySprintingSpeed / 100D; else hAllowedDistance = sprintingSpeed * cc.survivalFlySprintingSpeed / 100D;