mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Giving issues #9,#15,#16 Kleenex boxes and committing this test build.
This commit is contained in:
1 parent
dcc88090af
commit
9986469f4a
3 files changed
+28
-4
No files matched your search
@@ -209,7 +209,7 @@ public class PlayerListener extends EventListener
|
||||
double x = distance.getXDifference();
|
||||
double y = distance.getYDifference();
|
||||
double z = distance.getZDifference();
|
||||
if(checkManager.willCheck(player, CheckType.FLY) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && backend.checkFlight(player, from.getY(), to.getY()))
|
||||
if(checkManager.willCheck(player, CheckType.FLY) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && backend.checkFlight(player, distance))
|
||||
{
|
||||
from.setX(from.getX()-1);
|
||||
from.setY(from.getY()-1);
|
||||
@@ -224,7 +224,7 @@ public class PlayerListener extends EventListener
|
||||
}
|
||||
log("tried to fly.",player,CheckType.FLY);
|
||||
}
|
||||
if(checkManager.willCheck(player, CheckType.FLY) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && backend.checkYAxis(player))
|
||||
if(checkManager.willCheck(player, CheckType.FLY) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && backend.checkYAxis(player, distance))
|
||||
{
|
||||
from.setX(from.getX()-1);
|
||||
from.setY(from.getY()-1);
|
||||
|
||||
@@ -278,8 +278,15 @@ public class Backend
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkYAxis(Player player)
|
||||
public boolean checkYAxis(Player player, Distance distance)
|
||||
{
|
||||
//Arrow to the knee check
|
||||
if(distance.getYDifference() > 400) {
|
||||
//teleport. so just cancel.
|
||||
return false;
|
||||
}
|
||||
|
||||
//Arrow to the knee check
|
||||
if(!player.isFlying())
|
||||
{
|
||||
double y1 = player.getLocation().getY();
|
||||
@@ -341,8 +348,17 @@ public class Backend
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkFlight(Player player, double y1, double y2)
|
||||
public boolean checkFlight(Player player, Distance distance)
|
||||
{
|
||||
//Arrow to the knee check
|
||||
if(distance.getYDifference() > 400) {
|
||||
//teleport. so just cancel.
|
||||
return false;
|
||||
}
|
||||
|
||||
//Arrow to the knee check
|
||||
double y1 = distance.fromY();
|
||||
double y2 = distance.toY();
|
||||
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||
if(y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player))
|
||||
{
|
||||
|
||||
@@ -29,6 +29,14 @@ public class Distance
|
||||
l1 = to;
|
||||
l2 = from;
|
||||
}
|
||||
|
||||
public double fromY() {
|
||||
return l2.getY();
|
||||
}
|
||||
|
||||
public double toY() {
|
||||
return l1.getY();
|
||||
}
|
||||
|
||||
public double getXDifference()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user