Hopefully a quick fix for issue #71 - check for vines before fly check

This commit is contained in:
H31IX committed 2012-06-13 20:51:00 -04:00
1 parent 79b6b787ff
commit 6e4b4e4e46
2 files changed
+10 -5

No files matched your search

@@ -173,7 +173,7 @@ public class Backend
public boolean checkSpider(Player player, double y) public boolean checkSpider(Player player, double y)
{ {
if (y <= LADDER_Y_MAX && y >= LADDER_Y_MIN && !Utilities.isOnLadder(player)) if (y <= LADDER_Y_MAX && y >= LADDER_Y_MIN && !Utilities.isOnClimbableBlock(player))
{ {
return true; return true;
} }
@@ -388,7 +388,7 @@ public class Backend
{ {
return false; return false;
} }
if (!isMovingExempt(player) && !Utilities.isOnLadder(player) && !player.isInsideVehicle() && !Utilities.isInWater(player)) if (!isMovingExempt(player) && !Utilities.isOnClimbableBlock(player) && !player.isInsideVehicle() && !Utilities.isInWater(player))
{ {
double y1 = player.getLocation().getY(); double y1 = player.getLocation().getY();
String name = player.getName(); String name = player.getName();
@@ -459,7 +459,7 @@ 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);
if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player) && !Utilities.isOnVine(player))
{ {
String name = player.getName(); String name = player.getName();
if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock()) && !Utilities.isInWater(player)) if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock()) && !Utilities.isInWater(player))
@@ -520,7 +520,7 @@ public class Backend
max += 12; max += 12;
} }
Block block = player.getLocation().getBlock(); Block block = player.getLocation().getBlock();
if (!isMovingExempt(player) && !Utilities.isInWater(player) && !Utilities.isOnLadder(player) && !player.isInsideVehicle()) if (!isMovingExempt(player) && !Utilities.isInWater(player) && !Utilities.isOnClimbableBlock(player) && !player.isInsideVehicle())
{ {
String name = player.getName(); String name = player.getName();
if (y1 < y2) if (y1 < y2)
@@ -126,11 +126,16 @@ public final class Utilities
return player.getLocation().getBlock().isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid(); return player.getLocation().getBlock().isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid();
} }
public static boolean isOnLadder(Player player) public static boolean isOnClimbableBlock(Player player)
{ {
return player.getLocation().getBlock().getType() == Material.VINE || player.getLocation().getBlock().getType() == Material.LADDER; return player.getLocation().getBlock().getType() == Material.VINE || player.getLocation().getBlock().getType() == Material.LADDER;
} }
public static boolean isOnVine(Player player)
{
return player.getLocation().getBlock().getType() == Material.VINE;
}
public static boolean isInt(String string) public static boolean isInt(String string)
{ {
boolean x = false; boolean x = false;