mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +00:00
Fixed lily pad again.
This commit is contained in:
1 parent
17eda0e472
commit
98c680f770
2 files changed
+18
-4
No files matched your search
@@ -193,7 +193,8 @@ public class Backend
|
|||||||
|
|
||||||
public boolean checkWaterWalk(Player player, double x, double z)
|
public boolean checkWaterWalk(Player player, double x, double z)
|
||||||
{
|
{
|
||||||
if(player.getLocation().getBlock().isLiquid() && player.getVehicle() == null)
|
Block block = player.getLocation().getBlock();
|
||||||
|
if(block.isLiquid() && player.getVehicle() == null)
|
||||||
{
|
{
|
||||||
if(x > XZ_SPEED_MAX_WATER || z > XZ_SPEED_MAX_WATER && !Utilities.sprintFly(player) && player.getNearbyEntities(1, 1, 1).isEmpty())
|
if(x > XZ_SPEED_MAX_WATER || z > XZ_SPEED_MAX_WATER && !Utilities.sprintFly(player) && player.getNearbyEntities(1, 1, 1).isEmpty())
|
||||||
{
|
{
|
||||||
@@ -209,11 +210,11 @@ public class Backend
|
|||||||
|
|
||||||
public boolean checkFlight(Player player, double y1, double y2)
|
public boolean checkFlight(Player player, double y1, double y2)
|
||||||
{
|
{
|
||||||
|
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||||
if(y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0)
|
if(y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0)
|
||||||
{
|
{
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
if(Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player))
|
||||||
if(Utilities.cantStandAt(block))
|
|
||||||
{
|
{
|
||||||
int violation = 1;
|
int violation = 1;
|
||||||
if(!flightViolation.containsKey(name))
|
if(!flightViolation.containsKey(name))
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public final class Utilities
|
|||||||
}
|
}
|
||||||
public static boolean canStand(Block block)
|
public static boolean canStand(Block block)
|
||||||
{
|
{
|
||||||
return !block.isLiquid() || block.getType() == Material.AIR;
|
return !(block.isLiquid() || block.getType() == Material.AIR);
|
||||||
}
|
}
|
||||||
public static boolean isInstantBreak(Material m)
|
public static boolean isInstantBreak(Material m)
|
||||||
{
|
{
|
||||||
@@ -97,4 +97,17 @@ public final class Utilities
|
|||||||
{
|
{
|
||||||
return player.isSprinting() || player.isFlying();
|
return player.isSprinting() || player.isFlying();
|
||||||
}
|
}
|
||||||
|
public static boolean isOnLilyPad(Player player)
|
||||||
|
{
|
||||||
|
Block block = player.getLocation().getBlock();
|
||||||
|
Material lily = Material.WATER_LILY;
|
||||||
|
if(block.getType() == lily || block.getRelative(BlockFace.NORTH).getType() == lily || block.getRelative(BlockFace.SOUTH).getType() == lily || block.getRelative(BlockFace.EAST).getType() == lily || block.getRelative(BlockFace.WEST).getType() == lily)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user