mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Added longreach prevention
This commit is contained in:
1 parent
8ccbd9cfba
commit
db8686eea6
4 files changed
+96
-1
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package net.h31ix.anticheat.checks;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
public class LengthCheck {
|
||||
Location l1, l2;
|
||||
|
||||
public LengthCheck(Location l1, Location l2)
|
||||
{
|
||||
this.l1 = l1;
|
||||
this.l2 = l2;
|
||||
}
|
||||
|
||||
public double getXDifference()
|
||||
{
|
||||
double bx = l1.getX();
|
||||
double px = l2.getX();
|
||||
double xdiff = bx-px;
|
||||
if(xdiff < 0)
|
||||
{
|
||||
xdiff = -xdiff;
|
||||
}
|
||||
return xdiff;
|
||||
}
|
||||
|
||||
public double getYDifference()
|
||||
{
|
||||
double by = l1.getY();
|
||||
double py = l2.getY();
|
||||
double ydiff = by-py;
|
||||
if(ydiff < 0)
|
||||
{
|
||||
ydiff = -ydiff;
|
||||
}
|
||||
return ydiff;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user