Fiixed bug #30 - fixed teleporting players down when they are not flying

This commit is contained in:
H31IX committed 2012-06-08 16:06:11 -04:00
1 parent 6db2d521ae
commit daed224439
1 file changed
+4 -3
@@ -169,7 +169,7 @@ public class Backend
public boolean checkYSpeed(Player player,double y) public boolean checkYSpeed(Player player,double y)
{ {
if(/*!player.isFlying() &&*/ player.getVehicle() == null && y > Y_SPEED_MAX) if(player.getVehicle() == null && y > Y_SPEED_MAX)
{ {
return true; return true;
} }
@@ -397,7 +397,7 @@ public class Backend
yAxisLastViolation.put(name, System.currentTimeMillis()); yAxisLastViolation.put(name, System.currentTimeMillis());
if(g.getBlock().getTypeId() == 0) if(g.getBlock().getTypeId() == 0)
{ {
player.teleport(g); player.teleport(g);
} }
return true; return true;
} }
@@ -425,10 +425,11 @@ public class Backend
double y1 = distance.fromY(); double y1 = distance.fromY();
double y2 = distance.toY(); double y2 = distance.toY();
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN); Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
System.out.println("block below: "+block.getType()+" block at: "+player.getLocation().getBlock().getType());
if(y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) if(y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player))
{ {
String name = player.getName(); String name = player.getName();
if(Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && !Utilities.canStand(player.getLocation().getBlock()) && !Utilities.isSubmersed(player)) if(Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock()) && !Utilities.isSubmersed(player))
{ {
int violation = 1; int violation = 1;
if(!flightViolation.containsKey(name)) if(!flightViolation.containsKey(name))