mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-26 10:28:05 +01:00
Add convenience methods to TrigUtil.
This commit is contained in:
parent
21eaeac5fa
commit
e5911fdb8d
@ -192,12 +192,40 @@ public class TrigUtil {
|
||||
* the location1
|
||||
* @param location2
|
||||
* the location2
|
||||
* @return the double
|
||||
* @return The distance between the locations.
|
||||
*/
|
||||
public static final double distance(final Location location1, final Location location2)
|
||||
{
|
||||
return distance(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* 3D-distance of two locations.
|
||||
*
|
||||
* @param location1
|
||||
* the location1
|
||||
* @param location2
|
||||
* the location2
|
||||
* @return The distance between the locations.
|
||||
*/
|
||||
public static final double distance(final PlayerLocation location1, final Location location2)
|
||||
{
|
||||
return distance(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* 3D-distance of two locations.
|
||||
*
|
||||
* @param location1
|
||||
* the location1
|
||||
* @param location2
|
||||
* the location2
|
||||
* @return The distance between the locations.
|
||||
*/
|
||||
public static final double distance(final PlayerLocation location1, final PlayerLocation location2)
|
||||
{
|
||||
return distance(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* 3d-distance from location (exact) to block middle.
|
||||
|
Loading…
Reference in New Issue
Block a user