Respect speed for speed + potion; shade Updater. Fixes #259

This commit is contained in:
gravitylow committed 2014-01-16 22:03:29 -05:00
1 parent d1804572aa
commit 870cebec59
5 files changed
+47 -7

No files matched your search

@@ -304,8 +304,13 @@ public class Backend {
reason = "while flying ";
max = magic.XZ_SPEED_MAX_FLY;
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
reason = "with speed potion ";
max = magic.XZ_SPEED_MAX_POTION;
if (player.isSprinting()) {
reason = "with speed potion while sprinting ";
max = magic.XZ_SPEED_MAX_POTION_SPRINT;
} else {
reason = "with speed potion ";
max = magic.XZ_SPEED_MAX_POTION;
}
} else if (player.isSprinting()) {
reason = "while sprinting ";
max = magic.XZ_SPEED_MAX_SPRINT;
@@ -440,7 +445,7 @@ public class Backend {
if (distance.getYDifference() > magic.TELEPORT_MIN || distance.getYDifference() < 0) {
return PASS;
}
if (!isMovingExempt(player) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && !Utilities.isClimbableBlock(player.getLocation().add(0, -1, 0).getBlock()) && !player.isInsideVehicle() && !Utilities.isInWater(player)) {
if (!isMovingExempt(player) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && !Utilities.isClimbableBlock(player.getLocation().add(0, -1, 0).getBlock()) && !player.isInsideVehicle() && !Utilities.isInWater(player) && !hasJumpPotion(player)) {
double y1 = player.getLocation().getY();
String name = player.getName();
// Fix Y axis spam.
@@ -1041,6 +1046,14 @@ public class Backend {
}
}
public boolean hasJumpPotion(Player player) {
return player.hasPotionEffect(PotionEffectType.JUMP);
}
public boolean hasSpeedPotion(Player player) {
return player.hasPotionEffect(PotionEffectType.SPEED);
}
public void processChatSpammer(Player player) {
User user = manager.getUserManager().getUser(player.getName());
int level = chatLevel.containsKey(user.getName()) ? chatLevel.get(user.getName()) : 0;