Don't check YSpeed or NoFall for sleeping players

Fixes http://bugs.h31ix.net/issues.php?issue=68
This commit is contained in:
TerrorBite committed 2012-11-13 20:55:24 +10:00
1 parent 39db8afe81
commit 375bae04d0
1 file changed
+2 -2
@@ -220,7 +220,7 @@ public class Backend
public boolean checkYSpeed(Player player, double y)
{
if (!player.isInsideVehicle() && y > magic.Y_SPEED_MAX && !isDoing(player, velocitized, magic.VELOCITY_TIME) && !player.hasPotionEffect(PotionEffectType.JUMP))
if (!player.isInsideVehicle() && !player.isSleeping() && y > magic.Y_SPEED_MAX && !isDoing(player, velocitized, magic.VELOCITY_TIME) && !player.hasPotionEffect(PotionEffectType.JUMP))
{
return true;
}
@@ -230,7 +230,7 @@ public class Backend
public boolean checkNoFall(Player player, double y)
{
String name = player.getName();
if (player.getGameMode() != GameMode.CREATIVE && player.getVehicle() == null && !isMovingExempt(player) && !justPlaced(player) && !Utilities.isInWater(player))
if (player.getGameMode() != GameMode.CREATIVE && !player.isInsideVehicle() && !player.isSleeping() && !isMovingExempt(player) && !justPlaced(player) && !Utilities.isInWater(player))
{
if (player.getFallDistance() == 0)
{