mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +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 x = distance.getXDifference();
|
||||||
double y = distance.getYDifference();
|
double y = distance.getYDifference();
|
||||||
double z = distance.getZDifference();
|
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.setX(from.getX()-1);
|
||||||
from.setY(from.getY()-1);
|
from.setY(from.getY()-1);
|
||||||
@@ -224,7 +224,7 @@ public class PlayerListener extends EventListener
|
|||||||
}
|
}
|
||||||
log("tried to fly.",player,CheckType.FLY);
|
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.setX(from.getX()-1);
|
||||||
from.setY(from.getY()-1);
|
from.setY(from.getY()-1);
|
||||||
|
|||||||
@@ -278,8 +278,15 @@ public class Backend
|
|||||||
return false;
|
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())
|
if(!player.isFlying())
|
||||||
{
|
{
|
||||||
double y1 = player.getLocation().getY();
|
double y1 = player.getLocation().getY();
|
||||||
@@ -341,8 +348,17 @@ public class Backend
|
|||||||
return false;
|
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);
|
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||||
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))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ public class Distance
|
|||||||
l2 = from;
|
l2 = from;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double fromY() {
|
||||||
|
return l2.getY();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double toY() {
|
||||||
|
return l1.getY();
|
||||||
|
}
|
||||||
|
|
||||||
public double getXDifference()
|
public double getXDifference()
|
||||||
{
|
{
|
||||||
return Math.abs(l1.getX()-l2.getX());
|
return Math.abs(l1.getX()-l2.getX());
|
||||||
|
|||||||
Reference in new issue
Block a user