mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Fiixed bug #30 - fixed teleporting players down when they are not flying
This commit is contained in:
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))
|
||||||
|
|||||||
Reference in new issue
Block a user